ayushyadav7970824760/goldensellingstore_botPublic · Bot Template

AIThis Telegram store bot lets customers browse digital products and plans, apply coupons, add funds via UPI, and receive purchased keys. It includes a full admin panel for managing products, reordering items, setting reseller prices, viewing and removing key stock, configuring UPI payment details and update links, and checking user balances. Co-admins and resellers are supported, and support tickets are forwarded to the admin.

Commercedigital_storeadmin_panelupi_paymentsresellercouponskey_stock
ProfileTelegram
146 commands0 envUpdated 2d agoCreated Sep 5, 2026
Back to folder

commands/_menu.js

javascript · 126 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    return resBal.toFixed(2);33  })();34 35  // 💎 CANONICAL WELCOME — exactly the same on /start, /menu and /back.36  // Do not read custom_welcome_text here; this prevents old/new welcome glitches.37  var BOT_DISPLAY_NAME = "GOLDEN SELLING STORE";38  var U = {39    shop: "<tg-emoji emoji-id='5866053971960929280'>🛒</tg-emoji>",40    update: "<tg-emoji emoji-id='5208790878931415568'>🔄</tg-emoji>",41    money: "<tg-emoji emoji-id='5409048419211682843'>💰</tg-emoji>",42    profile: "<tg-emoji emoji-id='6145572393499762737'>⚙️</tg-emoji>",43    refer: "<tg-emoji emoji-id='5823654080584618403'>🔗</tg-emoji>",44    how: "<tg-emoji emoji-id='6192842983948162969'>❗</tg-emoji>",45    support: "<tg-emoji emoji-id='6267129592998270736'>✈️</tg-emoji>",46    gift: "<tg-emoji emoji-id='6194922667242429131'>🎁</tg-emoji>",47    balance: "<tg-emoji emoji-id='5231200819986047254'>💰</tg-emoji>",48    arrow: "<tg-emoji emoji-id='6057415823222379852'>👇</tg-emoji>"49  };50  var welcomeMessage =51    "<blockquote>" + U.shop + " <b>" + BOT_DISPLAY_NAME + "</b> " + U.shop + "</blockquote>\n" +52    "➤ ───────────────────\n" +53    "├ " + U.shop + " <b>Buy Now</b> : All Key Purchase &amp; Instant Delivery\n" +54    "├ " + U.update + " <b>Check Update</b> : Check Setup Video And Update Apk\n" +55    "├ " + U.money + " <b>Add Balance</b> : Deposit Balance &amp; Secure Auto-Add Payment System\n" +56    "├ " + U.profile + " <b>My Profile + All History</b> : Check Your Account Information + All History\n" +57    "├ " + U.refer + " <b>Refer And Earn</b> : Share Refer Link &amp; Earn Money\n" +58    "├ " + U.how + " <b>How To Use Bot</b> : View Tutorial And Work This Bot\n" +59    "├ " + U.support + " <b>Support</b> : Bot Problem Fixed For Support Admin\n" +60    "├ " + U.gift + " <b>Daily Gift</b> : Free Spin and win random balance daily, Only one spin every 24 hours.\n" +61    "➤ ───────────────────\n" +62    "<blockquote>" + U.balance + " <b>Your Balance:</b> ₹" + userBal + "</blockquote>\n" +63    "➤ ───────────────────\n" +64    U.arrow + " <b>Select an option from the menu below:</b>";65 66  var MENU_EMOJI = {67    shop: Bot.getProperty("menu_emoji_shop") || "5866053971960929280",68    download: Bot.getProperty("menu_emoji_download") || "5208790878931415568",69    addfund: Bot.getProperty("menu_emoji_addfund") || "5409048419211682843",70    profile: Bot.getProperty("menu_emoji_profile") || "6145572393499762737",71    refer: Bot.getProperty("menu_emoji_refer") || "5823654080584618403",72    how: Bot.getProperty("menu_emoji_how") || "6192842983948162969",73    support: Bot.getProperty("menu_emoji_support") || "6267129592998270736",74    dailygift: Bot.getProperty("menu_emoji_dailygift") || "6194922667242429131",75    proof: Bot.getProperty("menu_emoji_proof") || "5330237710655306682",76    reseller: Bot.getProperty("menu_emoji_reseller") || "6102856637343600044"77  };78 79  // ONE canonical main menu. All entry points (/start, /menu, /back and80  // post-verification) use the same keyboard so the layout never switches.81  var multiColorKeyboard = [82    [{ text: "𝑩𝒖𝒚 𝑵𝒐𝒘", callback_data: "/buy_hack", style: "danger", icon_custom_emoji_id: MENU_EMOJI.shop }],83    [84      { text: "𝑪𝒉𝒆𝒄𝒌 𝑼𝒑𝒅𝒂𝒕𝒆", callback_data: "/download_updates", style: "success", icon_custom_emoji_id: MENU_EMOJI.download },85      { text: "𝑨𝒅𝒅 𝑩𝒂𝒍𝒂𝒏𝒄𝒆", callback_data: "/addfund", style: "primary", icon_custom_emoji_id: MENU_EMOJI.addfund }86    ],87    [{ text: "𝑴𝒚 𝑷𝒓𝒐𝒇𝒊𝒍𝒆 + 𝑨𝒍𝒍 𝑯𝒊𝒔𝒕𝒐𝒓𝒚", callback_data: "/profile", style: "success", icon_custom_emoji_id: MENU_EMOJI.profile }],88    [89      { text: "𝑹𝒆𝒇𝒆𝒓 𝑨𝒏𝒅 𝑬𝒂𝒓𝒏", callback_data: "/refer", style: "success", icon_custom_emoji_id: MENU_EMOJI.refer },90      { text: "𝑯𝒐𝒘 𝑻𝒐 𝑼𝒔𝒆 𝑩𝒐𝒕", callback_data: "/how", style: "primary", icon_custom_emoji_id: MENU_EMOJI.how }91    ],92    [93      { text: "𝑺𝒖𝒑𝒑𝒐𝒓𝒕", callback_data: "/support", style: "danger", icon_custom_emoji_id: MENU_EMOJI.support },94      { text: "𝑫𝒂𝒊𝒍𝒚 𝑮𝒊𝒇𝒕", callback_data: "/dailygift", style: "success", icon_custom_emoji_id: MENU_EMOJI.dailygift }95    ],96    [{ text: "𝑷𝒂𝒚𝒎𝒆𝒏𝒕 𝑷𝒓𝒐𝒐𝒇𝒔", url: (Bot.getProperty("payment_proof_link") || "https://t.me/GaluModz_Proof"), style: "success", icon_custom_emoji_id: MENU_EMOJI.proof }]97  ];98 99  if (Bot.getProperty("reseller_system_enabled") && !Bot.getProperty("is_reseller_" + userId)) {100    multiColorKeyboard.push([101      { text: "𝑹𝒆𝒔𝒆𝒍𝒍𝒆𝒓 𝑼𝒑𝒈𝒓𝒂𝒅𝒆", callback_data: "/reseller_upgrade", style: "success", icon_custom_emoji_id: MENU_EMOJI.reseller }102    ]);103  }104 105 106  if (request && request.callback_query && request.callback_query.id) {107    try { Api.answerCallbackQuery({ callback_query_id: request.callback_query.id }); } catch(qErr){}108    Api.editMessageText({109      chat_id: chat.chatid,110      message_id: request.callback_query.message.message_id,111      text: welcomeMessage,112      parse_mode: "HTML",113      reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })114    });115  } else {116    Api.sendMessage({117      chat_id: chat.chatid,118      text: welcomeMessage,119      parse_mode: "HTML",120      reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })121    });122  }123 124} catch (globalException) {125  Bot.sendMessage("🛑 <b>Menu Debug Error:</b> <code>" + globalException.message + "</code>", { parse_mode: "HTML" });126}