indrajitghosh20006/HgfhhuybotPublic · Bot Template
AIThis bot provides a command‑based admin interface for managing user balances, products, and resellers. It supports adding balances via UPI or Binance Pay, approving payments, and configuring product details and categories. The bot also handles user role changes, stock uploads, and offers a simple calculator UI for entering amounts. All interactions are handled through short commands and inline keyboards, with no long‑running listeners or external frameworks.
Utilityadminbalanceproductresellerpaymentupi
138 commands0 envUpdated 15h agoCreated Sep 27, 2026
commands/_back.js
javascript · 160 lines
1/**#command2name: /back3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🚀 PREMIUM STORE MASTER DASHBOARD (UPDATED WITH LUDO SPIN)14// STATUS: 100% PRODUCTION READY WITH LIVE BUTTON STYLES15// =========================================================16 17try {18 var userId = user.telegramid;19 20 // 💾 BROADCAST SYSTEM: Safe Loop Core21 var userList = [];22 try {23 userList = Bot.getProperty("all_users_list") || [];24 if (!Array.isArray(userList)) { userList = []; }25 } catch (propErr) {26 userList = [];27 }28 29 var userExists = false;30 for (var i = 0; i < userList.length; i++) {31 if (String(userList[i]) === String(userId)) {32 userExists = true;33 break;34 }35 }36 if (!userExists) {37 userList.push(String(userId));38 Bot.setProperty("all_users_list", userList, "json");39 }40 41 // 📊 REAL BALANCE FETCH42 var userBal = "0.00";43 try {44 var res = 0;45 if (Libs && Libs.ResourcesLib) {46 res = Libs.ResourcesLib.userRes("balance").value() || 0;47 }48 userBal = Number(res).toFixed(2);49 } catch (balErr) {50 userBal = Number(res || 0).toFixed(2);51 }52 53 // 💎 WELCOME MESSAGE EMOJIS (Sirf Text Message ke liye)54 var EMJ_HEADER_ROCKET = "<tg-emoji emoji-id='5217822164362739968'>🚀</tg-emoji>";55 var EMJ_HEADER_NEW = "<tg-emoji emoji-id='6194809138371904539'>✨</tg-emoji>"; 56 var EMJ_HEADER_SHIELD = "<tg-emoji emoji-id='6113743082358841933'>🔰</tg-emoji>";57 58 // Welcome message ke saare items ke variables:59 var MSG_EMJ_STORE = "<tg-emoji emoji-id='5866053971960929280'>🛒</tg-emoji>";60 var MSG_EMJ_FFID = "<tg-emoji emoji-id='5334890573281114250'>🎮</tg-emoji>"; 61 var MSG_EMJ_PROFILE = "<tg-emoji emoji-id='5260399854500191689'>🔰</tg-emoji>";62 var MSG_EMJ_ADDBAL = "<tg-emoji emoji-id='6147815702163102310'>✨</tg-emoji>";63 var MSG_EMJ_HISTORY = "<tg-emoji emoji-id='6113743082358841933'>🔰</tg-emoji>";64 var MSG_EMJ_LUDO = "<tg-emoji emoji-id='5371043439020353782'>🎲</tg-emoji>"; // Ludo Spin Custom Emoji65 var MSG_EMJ_TUTORIAL = "<tg-emoji emoji-id='5258077307985207053'>📹</tg-emoji>";66 var MSG_EMJ_PROOF = "<tg-emoji emoji-id='5330237710655306682'>✅</tg-emoji>"; // Payment Proof Custom Emoji67 var MSG_EMJ_SUPPORT = "<tg-emoji emoji-id='5436113877181941026'>🔰</tg-emoji>";68 69 // Naye aur Updated Emojis70 var EMJ_PREMIUM_MENU = "<tg-emoji emoji-id='5406745015365943482'>✨</tg-emoji>";71 var EMJ_YOUR_BALANCE = "<tg-emoji emoji-id='5231200819986047254'>💰</tg-emoji>";72 var EMJ_GET_STARTED = "<tg-emoji emoji-id='6057415823222379852'>👇</tg-emoji>";73 74 // 📝 FULL WELCOME MESSAGE — synced with /start design (‼️ 𝑩𝑨𝑫𝑺𝑯𝑨 メ 𝑺𝑯𝑶𝑷 🛍️)75 var welcomeMessage =76 "<tg-emoji emoji-id=\"6266967801580231067\">💎</tg-emoji> <tg-emoji emoji-id=\"5866053971960929280\">🏪</tg-emoji> <b>—‼️ 𝑩𝑨𝑫𝑺𝑯𝑨 メ 𝑺𝑯𝑶𝑷 🛍️ —</b> <tg-emoji emoji-id=\"5866053971960929280\">🏪</tg-emoji> <tg-emoji emoji-id=\"6266967801580231067\">💎</tg-emoji>\n\n" +77 "<tg-emoji emoji-id=\"6093677128295914531\">🎉</tg-emoji> <b>Hello, " + ((user && user.first_name) ? user.first_name.toUpperCase() : "RESELLER") + "!</b>\n\n" +78 "<tg-emoji emoji-id=\"6080228009439141516\">💧</tg-emoji> <b>Genuine, limited-stock books. Instant delivery.</b>\n\n" +79 "<tg-emoji emoji-id=\"6093591495237967001\">🌐</tg-emoji> Wide product catalog\n" +80 "<tg-emoji emoji-id=\"6215386799133433653\">🔑</tg-emoji> Instant delivery on payment\n" +81 "<tg-emoji emoji-id=\"6312263493051489212\">💰</tg-emoji> Multiple payment gateways\n" +82 "<tg-emoji emoji-id=\"6100170496077204999\">👑</tg-emoji> 24/7 admin support\n\n" +83 "<i>Balance: ₹" + userBal + "</i>\n\n" +84 "<i>Tap any button below to begin:</i> " + EMJ_GET_STARTED;85 86 // 🎨 KEYBOARD — same layout as /start87 var multiColorKeyboard = [88 [{ text: "Shop Now", callback_data: "/buy_hack", style: "primary", icon_custom_emoji_id: "5866053971960929280" }],89 [90 { text: "Profile", callback_data: "/profile", style: "primary", icon_custom_emoji_id: "5260399854500191689" },91 { text: "Add Balance", callback_data: "/addfund", style: "success", icon_custom_emoji_id: "6147815702163102310" }92 ],93 [94 { text: "My Keys", callback_data: "/mykey", style: "primary", icon_custom_emoji_id: "6113743082358841933" },95 { text: "How to use", callback_data: "/how", style: "danger", icon_custom_emoji_id: "6080214566191505147" }96 ],97 [98 { text: "Download Files", callback_data: "/download_updates", style: "primary", icon_custom_emoji_id: "5208790878931415568" },99 { text: "Lucky Spin", callback_data: "/dailygift", style: "success", icon_custom_emoji_id: "6194922667242429131" }100 ],101 [102 { text: "Refer & Earn", callback_data: "/refer", style: "success", icon_custom_emoji_id: "5823654080584618403" },103 { text: "Support", callback_data: "/support", style: "danger", icon_custom_emoji_id: "5436113877181941026" }104 ],105 [{ text: "Payment Proofs", url: (Bot.getProperty("payment_proof_link") || "https://t.me/DevModz_Proof"), style: "success", icon_custom_emoji_id: "5330237710655306682" }]106 ];107 108 // 👑 Conditional Reseller Upgrade button109 if (Bot.getProperty("reseller_system_enabled") && !Bot.getProperty("is_reseller_" + userId)) {110 multiColorKeyboard.push([111 { text: "Reseller Upgrade", callback_data: "/reseller_upgrade", style: "success", icon_custom_emoji_id: "6102856637343600044" }112 ]);113 }114 115 // 🔄 Safe Callback Loading Controller116 var queryId = null;117 if (request) {118 if (request.id) { queryId = request.id; }119 else if (request.callback_query && request.callback_query.id) { queryId = request.callback_query.id; }120 }121 122 if (queryId) {123 try { Api.answerCallbackQuery({ callback_query_id: queryId }); } catch(qErr){}124 }125 126 // ⚡ Native Execution Route (Send vs Edit Handler)127 // ✅ BUG FIX: agar previous message ek PHOTO thi (jaise DP-attached Profile),128 // Telegram editMessageText use hi nahi kar sakta uspar — isi wajah se Profile129 // se "Back" click karne par kuch hota hi nahi tha. Ab photo ho to delete karke130 // fresh text message bheja jaata hai.131 if (request && request.message && request.message.message_id) {132 if (request.message.photo) {133 try { Api.deleteMessage({ chat_id: chat.chatid, message_id: request.message.message_id }); } catch (delErr) {}134 Api.sendMessage({135 chat_id: chat.chatid,136 text: welcomeMessage,137 parse_mode: "HTML",138 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })139 });140 } else {141 Api.editMessageText({142 chat_id: chat.chatid,143 message_id: request.message.message_id,144 text: welcomeMessage,145 parse_mode: "HTML",146 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })147 });148 }149 } else {150 Api.sendMessage({151 chat_id: chat.chatid,152 text: welcomeMessage,153 parse_mode: "HTML",154 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })155 });156 }157 158} catch (globalException) {159 Bot.sendMessage("🛑 <b>Dashboard Debug Error:</b> <code>" + globalException.message + "</code>", { parse_mode: "HTML" });160}