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/_removekey.js
javascript Β· 110 lines
1/**#command2name: /removekey3answer: 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 if (!params) {58 Bot.sendMessage("β <b>Usage:</b>\n<code>/removekey PRODUCT NAME | DAYS</code>\n\n<i>Example: DRIP CLIENT | 1_Day</i>", { parse_mode: "HTML" });59 return;60 }61 62 var args = params.split("|");63 if (args.length < 2) {64 Bot.sendMessage("β <b>Format Error!</b> Use Pipe symbol:\n<code>/removekey PRODUCT NAME | DAYS</code>", { parse_mode: "HTML" });65 return;66 }67 68 var prodName = args[0].trim();69 var planDays = args[1].trim();70 var cleanPlanDays = planDays.includes("_Day") ? planDays : planDays + "_Day";71 72 var stockKeyText = "stock_" + prodName + "_" + cleanPlanDays;73 var keyStock = Bot.getProperty(stockKeyText) || [];74 75 if (keyStock.length === 0) {76 Bot.sendMessage("β Product: <b>" + prodName + " (" + cleanPlanDays + ")</b> ka stock already empty hai!", { parse_mode: "HTML" });77 return;78 }79 80 var inlineButtons = [];81 82 // Har ek key ke liye ek individual delete button banana83 for (var i = 0; i < keyStock.length; i++) {84 var fullKey = keyStock[i];85 // Display ke liye key ka chota part dikhana taaki button bada na ho86 var shortKey = fullKey.length > 15 ? fullKey.substring(0, 12) + "..." : fullKey; 87 88 inlineButtons.push([89 {90 text: "ποΈ Key " + (i + 1) + " [" + shortKey + "]",91 // Callback me parameters pass karna: index_number | prodName | planDays92 callback_data: "/deletekey_now " + i + "|" + prodName + "|" + cleanPlanDays93 }94 ]);95 }96 97 var menuText = "<blockquote><b>ποΈ SELECT KEY TO REMOVE</b>\n\n" +98 "β’ <b>Product:</b> <code>" + prodName + "</code>\n" +99 "β’ <b>Plan:</b> <code>" + cleanPlanDays + "</code>\n" +100 "β’ <b>Total Keys:</b> <code>" + keyStock.length + "</code>\n\n" +101 "<i>Niche diye gaye buttons me se jis key ko remove karna hai, uspar click karein:</i></blockquote>";102 103 Bot.sendMessage(menuText, {104 parse_mode: "HTML",105 reply_markup: JSON.stringify({ inline_keyboard: inlineButtons })106 });107 108} catch (err) {109 Bot.sendMessage("β οΈ Error: " + err.message);110}