indrajitghosh20006/Igstore_01botPublic ยท Bot Template
AIThe bot provides an admin interface for a digital store, allowing the owner or coโadmins to add balances, products, plans, and categories. It supports payment workflows via UPI and Binance Pay, automatically generating QR codes and handling manual approval of deposits. The code patches inline keyboards to use premium emoji icons and includes helper functions for user and bot properties. Overall, it serves as a commerce management tool for a Telegram-based storefront.
Commercestoreadminbalanceproductplancategory
170 commands0 envUpdated 8h agoCreated Oct 30, 2026
commands/_ff_id_menu.js
javascript ยท 176 lines
1/**#command2name: /ff_id_menu3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// PREMIUM BUTTON ICONS13(function(){14 try {15 if (!JSON.__premiumPatched) {16 var __origStringify = JSON.stringify;17 JSON.stringify = function(value, replacer, space) {18 try {19 if (value && value.inline_keyboard && Array.isArray(value.inline_keyboard)) {20 var premiumIds = [21 "6143444134125379822",22 "6091379307907652768",23 "6147534454819661264",24 "6147817325660741985",25 "6235683689292897318",26 "6102856637343600044"27 ];28 var rows = value.inline_keyboard.map(function(row, ri) {29 if (!Array.isArray(row)) return row;30 return row.map(function(btn, bi) {31 if (!btn || typeof btn !== "object") return btn;32 var copy = {};33 for (var k in btn) copy[k] = btn[k];34 if (!copy.icon_custom_emoji_id) copy.icon_custom_emoji_id = premiumIds[(ri + bi) % premiumIds.length];35 return copy;36 });37 });38 var cloned = {};39 for (var key in value) cloned[key] = value[key];40 cloned.inline_keyboard = rows;41 return __origStringify.call(JSON, cloned, replacer, space);42 }43 } catch (e) {}44 return __origStringify.call(JSON, value, replacer, space);45 };46 JSON.__premiumPatched = true;47 }48 } catch (e) {}49})();50 51 52 53try {54 55 // Answer Callback safely56 if (request && request.id) {57 try {58 Api.answerCallbackQuery({ callback_query_id: request.id });59 } catch (e) {}60 } else if (request && request.callback_query && request.callback_query.id) {61 try {62 Api.answerCallbackQuery({ callback_query_id: request.callback_query.id });63 } catch (e) {}64 }65 66 // Safe Chat ID Selection67 var targetChatId = (chat && chat.chatid) ? chat.chatid : ((chat && chat.id) ? chat.id : user.telegramid);68 69 var categories = Bot.getProperty("ff_categories") || {};70 var inlineButtons = [];71 var hasCategories = false;72 73 for (var slug in categories) {74 if (!categories.hasOwnProperty(slug)) continue;75 76 hasCategories = true;77 78 var item = categories[slug];79 var stock = Bot.getProperty("ff_stock_" + slug) || [];80 81 if (!Array.isArray(stock)) stock = [];82 83 var buttonText = item.name;84 var buttonStyle = "primary"; // Default Blue Color85 86 if (stock.length === 0) {87 buttonText += " [OUT OF STOCK]";88 buttonStyle = "danger"; // Native Red Color89 } else {90 buttonText += " [Stock: " + stock.length + "]";91 buttonStyle = "success"; // Native Green Color92 }93 94 // Dynamic Emoji ID: Admin jo ID save karega, exact wahi inject hogi.95 var adminPremiumEmojiId = item.emoji_id || "5334890573281114250";96 97 inlineButtons.push([98 {99 text: buttonText,100 callback_data: "/select_id_product " + slug,101 style: buttonStyle, 102 icon_custom_emoji_id: adminPremiumEmojiId 103 }104 ]);105 }106 107 // Agar categories na ho toh Danger (Red) Button108 if (!hasCategories) {109 inlineButtons.push([110 {111 text: "โ ๏ธ No Platforms Active",112 callback_data: "/back",113 style: "danger"114 }115 ]);116 }117 118 // โ
UPDATED: Back button styled to Primary (Blue) with your specific Premium Emoji ID119 inlineButtons.push([120 {121 text: "Back to Dashboard",122 callback_data: "/back",123 style: "primary",124 icon_custom_emoji_id: "5893163582194978381"125 }126 ]);127 128 // ๐ Live stats footer129 var totalCategories = 0;130 var totalStockAll = 0;131 for (var s in categories) {132 if (!categories.hasOwnProperty(s)) continue;133 totalCategories++;134 var st = Bot.getProperty("ff_stock_" + s) || [];135 if (Array.isArray(st)) totalStockAll += st.length;136 }137 138 var text =139 "<blockquote><b><tg-emoji emoji-id='6080228009439141516'>๐ฎ</tg-emoji> FF ID STORE โ SELECT A PLATFORM <tg-emoji emoji-id='6093854128193152827'>๐ฅ</tg-emoji></b>\n\n" +140 "<i>Browse our available categories below. Instant delivery, verified accounts.</i></blockquote>\n" +141 "โโโโโโโโโโโโโโโโโโโโโ\n" +142 "<tg-emoji emoji-id='6080214566191505147'>๐ฆ</tg-emoji> <b>Categories:</b> <code>" + totalCategories + "</code> " +143 "<tg-emoji emoji-id='6091571559233755994'>๐ฅ</tg-emoji> <b>Total Stock:</b> <code>" + totalStockAll + " accounts</code>\n" +144 "โโโโโโโโโโโโโโโโโโโโโ";145 146 var targetMessageId = (request && request.message) ? request.message.message_id : null;147 148 var replyMarkupObj = {149 inline_keyboard: inlineButtons150 };151 152 if (targetMessageId) {153 Api.editMessageText({154 chat_id: targetChatId,155 message_id: targetMessageId,156 text: text,157 parse_mode: "HTML",158 reply_markup: JSON.stringify(replyMarkupObj)159 });160 } else {161 Api.sendMessage({162 chat_id: targetChatId,163 text: text,164 parse_mode: "HTML",165 reply_markup: JSON.stringify(replyMarkupObj)166 });167 }168 169} catch (e) {170 var errorChatId = (chat && chat.chatid) ? chat.chatid : user.telegramid;171 Api.sendMessage({172 chat_id: errorChatId,173 text: "โ Error structure:\n<code>" + e.message + "</code>",174 parse_mode: "HTML"175 });176}