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 7h agoCreated Oct 30, 2026
commands/_allkey.js
javascript Β· 119 lines
1/**#command2name: /allkey3answer: 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 var adminId = "7839151435"; // Aapki Admin ID55 if (String(chat.chatid) !== adminId) return;56 57 var productList = [];58 try {59 productList = Bot.getProperty("stored_products") || [];60 } catch (err) {61 productList = [];62 }63 64 var inlineButtons = [];65 66 // π‘οΈ SYSTEM SAFEGUARD: Agar master product data structural crash ho, to standard hardcoded check fallback lagana67 if (!productList || productList.length === 0) {68 // Agar empty list hai to manually display list paths69 inlineButtons.push([70 { text: "π Load DRIP CLIENT (1 Day)", callback_data: "/view_keys_list DRIP CLIENT|1_Day" }71 ]);72 } else {73 // Standard dynamic listing execution loop74 for (var i = 0; i < productList.length; i++) {75 var product = productList[i];76 if (!product || !product.name) continue;77 78 var plans = product.plans || [];79 // Default configurations display if plans empty80 if (plans.length === 0) {81 plans = [{ days: "1" }, { days: "7" }];82 }83 84 for (var j = 0; j < plans.length; j++) {85 var plan = plans[j];86 if (!plan || !plan.days) continue;87 88 var cleanProdName = product.name.trim();89 var cleanPlanDays = String(plan.days).trim() + "_Day";90 91 var stockKeyText = "stock_" + cleanProdName + "_" + cleanPlanDays;92 var currentStock = Bot.getProperty(stockKeyText) || [];93 94 inlineButtons.push([95 {96 text: cleanProdName.toUpperCase() + " (" + plan.days + " Days) - [" + currentStock.length + " Keys]",97 callback_data: "/view_keys_list " + cleanProdName + "|" + cleanPlanDays98 }99 ]);100 }101 }102 }103 104 // Final menu check interface safety attachment105 if (inlineButtons.length === 0) {106 inlineButtons.push([{ text: "π Refresh Stock Matrix", callback_data: "/allkey" }]);107 }108 109 var menuText = "<blockquote><b>π GLOBAL STOCK AUDIT LOGS</b>\n\n" +110 "<i>Niche diye gaye buttons me product aur uske plan ka live stock status dikh raha hai. Saari keys dekhne ke liye click karein:</i></blockquote>";111 112 Bot.sendMessage(menuText, {113 parse_mode: "HTML",114 reply_markup: JSON.stringify({ inline_keyboard: inlineButtons })115 });116 117} catch (err) {118 Bot.sendMessage("β οΈ Master Inventory Render Error: " + err.message);119}