suvo_/ImglyBotPublic · Bot Template

AIThis bot searches images through a Pinterest-related HTTP API and delivers results in private chats, inline mode, and guest business queries, with a search-more inline button and copy URL action. It tracks referrals from /start links, records referrer counts and lists, and displays referral benefits. The bot also handles business sticker messages by matching emoji and replying with a random sticker from the same set, asks users for feedback after feature usage, and includes an admin-only broadcast system plus a token-based clone-bot request flow.

Utilityimage-searchpinterestinline-modereferralbroadcastclone-bot
ProfileTelegram
27 commands3 envUpdated 2d agoCreated Jul 2, 2026
Back to folder

commands/_onStickerSet.js

javascript · 48 lines

Raw
1/**#command2name: /onStickerSet3answer: 4keyboard: 5parse_mode: 6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12var list = options.result.stickers;13var matched = [];14 15for (var i = 0; i < list.length; i++) {16  if (list[i].emoji == options.emoji) {17    var fileId = list[i].file_id || list[i].fileid || list[i].fileId;18 19    if (fileId) {20      matched.push(fileId);21    }22  }23}24 25if (list.length == 0) return;26 27var id;28 29if (matched.length > 1) {30  // একই emoji-এর sticker থেকে random31  do {32    id = matched[Math.floor(Math.random() * matched.length)];33  } while (id == options.fileId);34 35} else {36  // পুরো sticker set থেকে random37  do {38    var s = list[Math.floor(Math.random() * list.length)];39    id = s.file_id || s.fileid || s.fileId;40  } while (!id || id == options.fileId);41}42 43Api.sendSticker({44  business_connection_id: request.business_connection_id,45  chat_id: request.chat.id,46  sticker: id,47  reply_to_message_id: params48});