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/_set_payment_binance.js
javascript Β· 115 lines
1/**#command2name: /set_payment_binance3answer: 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// π‘ ADMIN β Quick one-line Binance Pay config (no QR).55// Usage: /set_payment_binance binance_id|usdt_address|rate56// Rate is optional. Use /set_payment_binance_btn for the full wizard57// (including QR upload).58// =========================================================59 60try {61 var adminId = Bot.getProperty("owner_id") || "7839151435";62 var isCoAdmin0 = Bot.getProperty("co_admin_" + String(chat.chatid));63 if (String(chat.chatid) !== adminId && !isCoAdmin0) {64 Bot.sendMessage("β You are not the admin!");65 return;66 }67 68 if (!params || params.trim() === "") {69 var currentId0 = Bot.getProperty("binance_pay_id") || "Not set";70 var currentAddr0 = Bot.getProperty("binance_usdt_address") || "Not set";71 var currentRate0 = Bot.getProperty("usd_rate") || "91 (default)";72 Bot.sendMessage(73 "β οΈ <b>Format:</b> <code>/set_payment_binance binance_id|usdt_address|91</code>\n" +74 "<i>(QR set karne ke liye Admin Panel me \"Set Payment (Binance Pay)\" button use karein)</i>\n\n" +75 "<b>Current Binance Pay ID:</b> <code>" + currentId0 + "</code>\n" +76 "<b>Current USDT Address:</b> <code>" + currentAddr0 + "</code>\n" +77 "<b>Current USD Rate:</b> <code>βΉ" + currentRate0 + " = $1</code>",78 { parse_mode: "HTML" }79 );80 return;81 }82 83 var rawInput = params.trim();84 var inputParts = rawInput.split("|");85 var newBinanceId = inputParts[0].trim();86 var newUsdtAddress = (inputParts.length > 1) ? inputParts[1].trim() : null;87 var newRate = (inputParts.length > 2) ? parseFloat(inputParts[2].trim()) : null;88 89 if (!newBinanceId) {90 Bot.sendMessage("β Invalid Binance Pay ID!", { parse_mode: "HTML" });91 return;92 }93 if (newRate !== null && (isNaN(newRate) || newRate <= 0)) {94 Bot.sendMessage("β Invalid USD Rate! Ek valid positive number bhejein, jaise 91.", { parse_mode: "HTML" });95 return;96 }97 98 Bot.setProperty("binance_pay_id", newBinanceId, "string");99 var confirmMsg = "β
<b>Binance payment config update ho gaya:</b>\nβ’ Binance Pay ID: <code>" + newBinanceId + "</code>";100 101 if (newUsdtAddress) {102 Bot.setProperty("binance_usdt_address", newUsdtAddress, "string");103 confirmMsg += "\nβ’ USDT Address: <code>" + newUsdtAddress + "</code>";104 }105 if (newRate !== null) {106 Bot.setProperty("usd_rate", newRate, "string");107 confirmMsg += "\nβ’ USD Rate: <code>βΉ" + newRate + " = $1</code>";108 }109 110 confirmMsg += "\n\n<i>Note: QR change karne ke liye Admin Panel wizard use karein.</i>";111 Bot.sendMessage(confirmMsg, { parse_mode: "HTML" });112 113} catch (err) {114 Bot.sendMessage("β οΈ Error: " + err.message);115}