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

javascript Β· 102 lines

Raw
1/**#command2name: /check_users3answer: 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// πŸ‘₯ COMMAND: /check_users55// STATUS: 100% OPERATIONAL & ANTI-CRASH CHUNK SYSTEM56// =========================================================57 58try {59  var adminId = "7839151435"; // Aapki Admin ID60 61  // Strict Admin Validation62  if (String(chat.chatid) !== adminId) {63    Bot.sendMessage("❌ Access Denied: Sirf Owner hi user database dekh sakta hai.");64    return;65  }66 67  // Fetch users array safely68  var userList = Bot.getProperty("all_users_list") || [];69  if (!Array.isArray(userList)) { userList = []; }70 71  if (userList.length === 0) {72    Bot.sendMessage("⚠️ <b>Database Empty:</b> Bot mein abhi tak koi bhi user register nahi hua hai.", { parse_mode: "HTML" });73    return;74  }75 76  var header = "<blockquote><b>πŸ‘₯ TOTAL REGISTERED USERS LIST</b>\n\n" +77               "πŸ“Š <b>Total Growth Node:</b> <code>" + userList.length + " Active Users</code></blockquote>\n" +78               "━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n";79 80  var bodyText = "";81  82  // Loop through all users and format83  for (var i = 0; i < userList.length; i++) {84    var userLine = "<b>[" + (i + 1) + "]</b> ID: <code>" + userList[i] + "</code>\n";85    86    // Memory and boundary protection: Split messages if character count exceeds 350087    if ((header + bodyText + userLine).length > 3500) {88      Bot.sendMessage(header + bodyText, { parse_mode: "HTML" });89      header = ""; // Clear header for subsequent chunks90      bodyText = ""; // Reset temporary storage buffer91    }92    bodyText += userLine;93  }94 95  // Print final remaining chunk safely96  if (bodyText.trim() !== "") {97    Bot.sendMessage(header + bodyText + "\n━━━━━━━━━━━━━━━━━━━━━━━━━━", { parse_mode: "HTML" });98  }99 100} catch (err) {101  Bot.sendMessage("πŸ›‘ <b>User Audit Error:</b> <code>" + err.message + "</code>", { parse_mode: "HTML" });102}