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/_deposit_stars.js
javascript Β· 104 lines
1/**#command2name: /deposit_stars3answer: 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// β TELEGRAM STARS β Deposit screen (Wallet top-up in Stars)55// Note: Stars balance is tracked SEPARATELY from the Rupee/UPI wallet,56// since Telegram Stars (XTR) is its own currency and can't be mixed 1:157// with rupee balance without a fixed conversion rate.58// =========================================================59 60try {61 var userId = String(user.telegramid);62 var chatId = chat.chatid;63 var starsBalance = Number(Bot.getProperty("stars_balance_" + userId) || 0);64 65 var text =66 "<blockquote>β <b>DEPOSIT TELEGRAM STARS</b></blockquote>\n" +67 "βββββββββββββββββββββ\n\n" +68 "β <b>Current Stars Balance:</b> <code>" + starsBalance + "</code>\n\n" +69 "<i>Choose an amount below, or enter a custom amount. Payment goes through Telegram's official Stars checkout β instant & secure.</i>\n" +70 "βββββββββββββββββββββ";71 72 var buttons = [73 [74 { text: "β 50", callback_data: "/send_stars_invoice deposit 50", style: "primary" },75 { text: "β 100", callback_data: "/send_stars_invoice deposit 100", style: "primary" },76 { text: "β 250", callback_data: "/send_stars_invoice deposit 250", style: "primary" }77 ],78 [79 { text: "β 500", callback_data: "/send_stars_invoice deposit 500", style: "primary" },80 { text: "β 1000", callback_data: "/send_stars_invoice deposit 1000", style: "primary" }81 ],82 [83 { text: "Custom Amount", callback_data: "/custom_stars_amount", style: "success", icon_custom_emoji_id: "6312263493051489212" }84 ],85 [86 { text: "Back to Menu", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }87 ]88 ];89 90 if (request && request.message && !request.message.photo) {91 Api.editMessageText({ chat_id: String(chatId), message_id: Number(request.message.message_id), text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: buttons }) });92 } else {93 if (request && request.message && request.message.photo) {94 try { Api.deleteMessage({ chat_id: chatId, message_id: request.message.message_id }); } catch (e) {}95 }96 Api.sendMessage({ chat_id: chatId, text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: buttons }) });97 }98 99 var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;100 if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {} }101 102} catch (err) {103 Bot.sendMessage("β οΈ Error: " + err.message);104}