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

javascript · 82 lines

Raw
1/**#command2name: /menu3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var userId = user.telegramid;14 15  // ✅ VERIFICATION CHECK16  var isVerified = (Bot.getProperty("verified_" + userId) === true) || (User.getProperty("verified_" + userId) === true);17 18  if (!isVerified) {19    Api.sendMessage({20      chat_id: chat.chatid,21      text: "<blockquote><b>🔰 Pehle account verify karein.</b>\nUse /start</blockquote>",22      parse_mode: "HTML"23    });24    return;25  }26 27  // 📊 REAL BALANCE FETCH — ✅ FIXED: ab same wallet store se read hoga jo purchase flows use karte hain28  // (Libs.ResourcesLib "balance" resource + admin bonus balance), taaki balance sab jagah same dikhe.29  var userBal = (function() {30    var resBal = 0;31    try { resBal = Number(Libs.ResourcesLib.userRes("balance").value()) || 0; } catch (e) {}32    var bonusBal = Number(Bot.getProperty("balance" + userId) || 0);33    return (resBal + bonusBal).toFixed(2);34  })();35 36  var welcomeMessage =37    "<tg-emoji emoji-id=\"6266967801580231067\">💎</tg-emoji> <tg-emoji emoji-id=\"5866053971960929280\">🏪</tg-emoji> <b>— BALA MOOD STORE —</b> <tg-emoji emoji-id=\"5866053971960929280\">🏪</tg-emoji> <tg-emoji emoji-id=\"6266967801580231067\">💎</tg-emoji>\n\n" +38    "<tg-emoji emoji-id=\"6080228009439141516\">💧</tg-emoji> <b>Genuine, limited-stock books. Instant delivery.</b>\n\n" +39    "<tg-emoji emoji-id='5231200819986047254'>💰</tg-emoji> <b>Balance:</b> ₹" + userBal + "\n\n" +40    "<i>Tap any button below to begin:</i> <tg-emoji emoji-id='6057415823222379852'>👇</tg-emoji>";41 42  var multiColorKeyboard = [43    [{ text: "Shop Now", callback_data: "/buy_hack", style: "primary", icon_custom_emoji_id: "5866053971960929280" }],44    [45      { text: "Profile", callback_data: "/profile", style: "primary", icon_custom_emoji_id: "5260399854500191689" },46      { text: "Add Balance", callback_data: "/addfund", style: "success", icon_custom_emoji_id: "6147815702163102310" }47    ],48    [49      { text: "My Keys", callback_data: "/mykey", style: "primary", icon_custom_emoji_id: "6113743082358841933" },50      { text: "How to use", callback_data: "/how", style: "danger", icon_custom_emoji_id: "6080214566191505147" }51    ],52    [{ text: "Payment Proofs", url: "https://t.me/GaluModz_Proof", style: "success", icon_custom_emoji_id: "5330237710655306682" }],53    [{ text: "Support", callback_data: "/support", style: "danger", icon_custom_emoji_id: "5436113877181941026" }]54  ];55 56  if (Bot.getProperty("reseller_system_enabled") && !Bot.getProperty("is_reseller_" + userId)) {57    multiColorKeyboard.push([58      { text: "Reseller Upgrade", callback_data: "/reseller_upgrade", style: "success", icon_custom_emoji_id: "6102856637343600044" }59    ]);60  }61 62  if (request && request.callback_query && request.callback_query.id) {63    try { Api.answerCallbackQuery({ callback_query_id: request.callback_query.id }); } catch(qErr){}64    Api.editMessageText({65      chat_id: chat.chatid,66      message_id: request.callback_query.message.message_id,67      text: welcomeMessage,68      parse_mode: "HTML",69      reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })70    });71  } else {72    Api.sendMessage({73      chat_id: chat.chatid,74      text: welcomeMessage,75      parse_mode: "HTML",76      reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })77    });78  }79 80} catch (globalException) {81  Bot.sendMessage("🛑 <b>Menu Debug Error:</b> <code>" + globalException.message + "</code>", { parse_mode: "HTML" });82}