indrajitghosh20006/Igstore_01botPublic Β· Bot Template

ProfileTelegram

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
Back to folder

commands/_download_updates.js

javascript Β· 100 lines

Raw
1/**#command2name: /download_updates3answer: 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// πŸ“₯ "Download Updates" button β€” premium update-channel section.55// Admin sets the redirect link via /set_update_link (see that file).56// =========================================================57 58try {59  var chatId = chat.chatid;60  var updateLink = Bot.getProperty("update_channel_link");61 62  var text =63    "<blockquote><tg-emoji emoji-id='6235683689292897318'>πŸ“₯</tg-emoji> <b>DOWNLOAD FILES</b></blockquote>\n" +64    "━━━━━━━━━━━━━━━━━━━━━\n\n" +65    "<tg-emoji emoji-id='6093677128295914531'>πŸŽ‰</tg-emoji> <i>Stay up to date with the latest files, features, and stock alerts!</i>\n\n" +66    (updateLink67      ? "<tg-emoji emoji-id='6080214566191505147'>πŸ”—</tg-emoji> <b>Tap the button below to open your files.</b>"68      : "<tg-emoji emoji-id='6093854128193152827'>⚠️</tg-emoji> <i>Download link abhi admin ne set nahi kiya hai.</i>") +69    "\n━━━━━━━━━━━━━━━━━━━━━";70 71  var buttons = [];72  if (updateLink) {73    buttons.push([{ text: "Download File", url: updateLink, style: "success", icon_custom_emoji_id: "6235683689292897318" }]);74  }75  buttons.push([{ text: "Back to Menu", callback_data: "/back", style: "primary", icon_custom_emoji_id: "5893163582194978381" }]);76 77  if (request && request.message) {78    try {79      Api.editMessageText({80        chat_id: String(chatId),81        message_id: Number(request.message.message_id),82        text: text,83        parse_mode: "HTML",84        reply_markup: JSON.stringify({ inline_keyboard: buttons })85      });86    } catch (e) {87      Api.sendMessage({ chat_id: chatId, text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: buttons }) });88    }89  } else {90    Api.sendMessage({ chat_id: chatId, text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: buttons }) });91  }92 93  var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;94  if (queryId) {95    try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {}96  }97 98} catch (err) {99  Bot.sendMessage("⚠️ Error: " + err.message);100}