kkapil9112/Aestheticmodes9_botPublic · Bot Template

AIA Telegram-based digital goods store bot with a full admin panel for managing products, plans, stock, keys, categories, resellers, balances, and coupons. It uses TeleBotHost APIs like Bot, Api, User, Libs.ResourcesLib, and HTTP to run a shop interface, handle admin-only commands, track users, and send inventory/balance summaries. The implementation appears focused on selling game-related accounts and keys such as FreeFire items, with customer-facing store, balance, coupon, and back-to-menu flows.

Commerceshopadmin-panelbalanceresellercouponsstock-management
ProfileTelegram
102 commands1 envUpdated 29d agoCreated Aug 9, 2026
Back to folder

commands/_allstocks.js

javascript · 64 lines

Raw
1/**#command2name: /allstocks3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  // 🔥 CALLBACK DATA CLEARING PIPELINE (Bypass loading spinner on buttons)14  if (typeof request !== "undefined" && request) {15    let queryId = request.id || (request.callback_query && request.callback_query.id);16    if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: queryId }); } catch(qErr){} }17  }18 19  var adminId = "8812621370";20  var targetChatId = (chat && chat.chatid) ? chat.chatid : ((user && user.telegramid) ? user.telegramid : adminId);21 22  if (String(targetChatId) !== adminId) {23      Api.sendMessage({ chat_id: targetChatId, text: "❌ Access Denied: Secure admin perimeter restricted." });24      return;25  }26 27  var categories = Bot.getProperty("ff_categories") || {};28  var keys = Object.keys(categories);29 30  if (keys.length === 0) {31    Api.sendMessage({32      chat_id: targetChatId,33      text: "📦 <b>Database status: EMPTY</b>\n\nAbhi system parameters mein koi category mapped nahi hai.",34      parse_mode: "HTML"35    });36    return;37  }38 39  var stockText = "<blockquote>🔍 <b>LIVE SYSTEM ID STOCK REPORT</b>\n\n<i>Live database nodes status evaluation:</i></blockquote>\n━━━━━━━━━━━━━━━━━━━━━━━━━━\n";40 41  for (var i = 0; i < keys.length; i++) {42    var slug = keys[i];43    var cat = categories[slug];44    var stockList = Bot.getProperty("ff_stock_" + slug) || [];45    if (!Array.isArray(stockList)) { stockList = []; }46    47    var count = stockList.length;48    var emoji = (cat.emoji_id) ? "<tg-emoji emoji-id='" + cat.emoji_id + "'>🔹</tg-emoji>" : "🔹";49    50    stockText += emoji + " <b>" + (cat.name || slug).toUpperCase() + ":</b> <code>" + count + " Items In Stock</code>\n";51  }52 53  stockText += "━━━━━━━━━━━━━━━━━━━━━━━━━━\n🎯 <i>Stock operations adjust karne ke liye physical dashboard console parameters use karein.</i>";54 55  Api.sendMessage({56    chat_id: targetChatId,57    text: stockText,58    parse_mode: "HTML"59  });60 61} catch(e) {62  var backupId = (user && user.telegramid) ? user.telegramid : "8812621370";63  Api.sendMessage({ chat_id: backupId, text: "⚠️ System Runtime Error: " + e.message });64}