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/_allstocks.js

javascript Β· 105 lines

Raw
1/**#command2name: /allstocks3answer: 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  // πŸ”₯ CALLBACK DATA CLEARING PIPELINE (Bypass loading spinner on buttons)55  if (typeof request !== "undefined" && request) {56    let queryId = request.id || (request.callback_query && request.callback_query.id);57    if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: queryId }); } catch(qErr){} }58  }59 60  var adminId = "7839151435";61  var targetChatId = (chat && chat.chatid) ? chat.chatid : ((user && user.telegramid) ? user.telegramid : adminId);62 63  if (String(targetChatId) !== adminId) {64      Api.sendMessage({ chat_id: targetChatId, text: "❌ Access Denied: Secure admin perimeter restricted." });65      return;66  }67 68  var categories = Bot.getProperty("ff_categories") || {};69  var keys = Object.keys(categories);70 71  if (keys.length === 0) {72    Api.sendMessage({73      chat_id: targetChatId,74      text: "πŸ“¦ <b>Database status: EMPTY</b>\n\nAbhi system parameters mein koi category mapped nahi hai.",75      parse_mode: "HTML"76    });77    return;78  }79 80  var stockText = "<blockquote>πŸ” <b>LIVE SYSTEM ID STOCK REPORT</b>\n\n<i>Live database nodes status evaluation:</i></blockquote>\n━━━━━━━━━━━━━━━━━━━━━━━━━━\n";81 82  for (var i = 0; i < keys.length; i++) {83    var slug = keys[i];84    var cat = categories[slug];85    var stockList = Bot.getProperty("ff_stock_" + slug) || [];86    if (!Array.isArray(stockList)) { stockList = []; }87    88    var count = stockList.length;89    var emoji = (cat.emoji_id) ? "<tg-emoji emoji-id='" + cat.emoji_id + "'>πŸ”Ή</tg-emoji>" : "πŸ”Ή";90    91    stockText += emoji + " <b>" + (cat.name || slug).toUpperCase() + ":</b> <code>" + count + " Items In Stock</code>\n";92  }93 94  stockText += "━━━━━━━━━━━━━━━━━━━━━━━━━━\n🎯 <i>Stock operations adjust karne ke liye physical dashboard console parameters use karein.</i>";95 96  Api.sendMessage({97    chat_id: targetChatId,98    text: stockText,99    parse_mode: "HTML"100  });101 102} catch(e) {103  var backupId = (user && user.telegramid) ? user.telegramid : "7839151435";104  Api.sendMessage({ chat_id: backupId, text: "⚠️ System Runtime Error: " + e.message });105}