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/_mykey.js
javascript Β· 143 lines
1/**#command2name: /mykey3answer: 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 53// =========================================================54// π MY KEYS β shows all purchased keys55// β
BUG FIXES:56// 1. Pehle photo message (Profile se aane par) editMessageText try karta tha57// jo Telegram me fail hota hai β isi wajah se "My Keys" click karne par58// kuch dikhta hi nahi tha.59// 2. catch(err) block errors ko SILENTLY hide kar raha tha β koi feedback60// hi nahi milta tha jab kuch fail hota.61// 3. Raw HTTP.post use ho raha tha bina success/error handling ke β ab62// consistent Api.* wrapper functions use hote hain (poore bot jaisa).63// =========================================================64 65try {66 let userKeys = User.getProperty("my_purchased_keys");67 let chatId = chat.chatid;68 69 let text = "";70 let keyboard = { inline_keyboard: [] };71 72 if (!userKeys || userKeys.length === 0) {73 text = "<blockquote>" +74 "<tg-emoji emoji-id='6192822213486321961'>π£</tg-emoji> <b>No keys found!</b>\n" +75 "<tg-emoji emoji-id='5866053971960929280'>π</tg-emoji> You haven't purchased anything yet." +76 "</blockquote>";77 78 keyboard.inline_keyboard = [79 [80 { text: "Shop Now", callback_data: "/buy_hack", style: "success", icon_custom_emoji_id: "5866053971960929280" },81 { text: "Back", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }82 ]83 ];84 } else {85 text = "<b>π Your Active Keys:</b>\n\n";86 87 for (let i = 0; i < userKeys.length; i++) {88 let keyData = userKeys[i];89 let pName = keyData.productName || keyData.product || "N/A";90 let pPrice = keyData.cost || keyData.price || "0";91 let pKey = keyData.key || "No Key Found";92 let pDays = keyData.days || "N/A";93 let pDate = keyData.date || "N/A";94 95 text += "<blockquote>" +96 "<tg-emoji emoji-id='6192822213486321961'>π£</tg-emoji> <b>Product Name:</b> " + pName + "\n" +97 "<tg-emoji emoji-id='6266967801580231067'>β³</tg-emoji> <b>Days:</b> " + pDays + "\n" +98 "<tg-emoji emoji-id='6176966310920983412'>β‘οΈ</tg-emoji> <b>Key:</b> <code>" + pKey + "</code>\n" +99 "<tg-emoji emoji-id='6267068789146260253'>π</tg-emoji> <b>Price:</b> βΉ" + pPrice + "\n" +100 "<tg-emoji emoji-id='5866053971960929280'>π
</tg-emoji> <b>Date:</b> " + pDate +101 "</blockquote>\n";102 }103 104 // Telegram caption/message length limits ke against safety trim (very large history)105 if (text.length > 3800) {106 text = text.substring(0, 3800) + "\n\n<i>... (list truncated β download full receipt from History)</i>";107 }108 109 keyboard.inline_keyboard = [110 [111 { text: "π§Ύ Download Receipt", callback_data: "/history_receipt", style: "primary", icon_custom_emoji_id: "6100170496077204999" }112 ],113 [114 { text: "Back To Menu", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }115 ]116 ];117 }118 119 // β
FIX: photo-message ho to delete + fresh send, warna edit; Api.* wrapper use hota hai120 if (request && request.message && request.message.message_id) {121 if (request.message.photo) {122 try { Api.deleteMessage({ chat_id: chatId, message_id: request.message.message_id }); } catch (delErr) {}123 Api.sendMessage({ chat_id: chatId, text: text, parse_mode: "HTML", reply_markup: JSON.stringify(keyboard) });124 } else {125 Api.editMessageText({126 chat_id: chatId,127 message_id: request.message.message_id,128 text: text,129 parse_mode: "HTML",130 reply_markup: JSON.stringify(keyboard)131 });132 }133 } else {134 Api.sendMessage({ chat_id: chatId, text: text, parse_mode: "HTML", reply_markup: JSON.stringify(keyboard) });135 }136 137 var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;138 if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {} }139 140} catch (err) {141 // β
FIX: ab error silently hide nahi hoti β user ko dikhti hai142 try { Bot.sendMessage("β οΈ My Keys Error: " + err.message, { parse_mode: "HTML" }); } catch (e) {}143}