devbro468/Dev_x_store_botPublic · Bot Template

AIThis bot operates a digital storefront (DEV X STORE) selling subscription-based products — likely game hacks, accounts, or access keys — categorized by platform (Android Root, Non-Root, iPhone). It features a reseller program with discounted pricing, a dual-currency wallet (INR balance + Telegram Stars/XTR), and a full admin/co-admin panel for managing products, plans, per-plan pricing, stock (keys/accounts), coupons, and API endpoints. Purchases flow through a plan selection screen offering wallet payment, Stars invoices (sendInvoice with XTR currency), and coupon application. Successful Stars payments are handled via successful_payment webhook, crediting wallet or delivering keys directly. Admin tools include user listing with chunked messaging, stock viewing/deletion with inline keyboards, co-admin management, and API registry updates. The bot registers users on first interaction and

Commercecommercedigital-goodsstars-paymentreseller-systemadmin-panelstock-management
ProfileTelegram
119 commands0 envUpdated 15d agoCreated Aug 23, 2026
Back to folder

commands/_menu.js

javascript · 84 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>— DEV MODZ STORE PANEL —</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    [53      { text: "Support", callback_data: "/support", style: "danger", icon_custom_emoji_id: "5436113877181941026" }54    ],55    [{ text: "Payment Proofs", url: (Bot.getProperty("payment_proof_link") || "https://t.me/DevModz_Proof"), style: "success", icon_custom_emoji_id: "5330237710655306682" }]56  ];57 58  if (Bot.getProperty("reseller_system_enabled") && !Bot.getProperty("is_reseller_" + userId)) {59    multiColorKeyboard.push([60      { text: "Reseller Upgrade", callback_data: "/reseller_upgrade", style: "success", icon_custom_emoji_id: "6102856637343600044" }61    ]);62  }63 64  if (request && request.callback_query && request.callback_query.id) {65    try { Api.answerCallbackQuery({ callback_query_id: request.callback_query.id }); } catch(qErr){}66    Api.editMessageText({67      chat_id: chat.chatid,68      message_id: request.callback_query.message.message_id,69      text: welcomeMessage,70      parse_mode: "HTML",71      reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })72    });73  } else {74    Api.sendMessage({75      chat_id: chat.chatid,76      text: welcomeMessage,77      parse_mode: "HTML",78      reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })79    });80  }81 82} catch (globalException) {83  Bot.sendMessage("🛑 <b>Menu Debug Error:</b> <code>" + globalException.message + "</code>", { parse_mode: "HTML" });84}