amanjha18v/AMAN_SHOPS_BOTPublic · Bot Template
AIAMAN SHOP STORE appears to be a Telegram automation bot. Commands include /*, /addbal, /addbal_all, /addbal_binance, /addbal_binance_approve, /addbal_binance_paid, /addbal_upi, /addcat_id. Observed in code: messaging, http, libs, keyboards, payments.
Utilityutility
132 commands0 envUpdated 6h agoCreated Sep 4, 2026
commands/_back.js
javascript · 162 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 var adminBal = Bot.getProperty("balance" + userId) || 0;49 userBal = (Number(res) + Number(adminBal)).toFixed(2);50 } catch (balErr) {51 var fallbackBal = Bot.getProperty("balance" + userId) || 0;52 userBal = Number(fallbackBal).toFixed(2);53 }54 55 // 💎 WELCOME MESSAGE EMOJIS (Sirf Text Message ke liye)56 var EMJ_HEADER_ROCKET = "<tg-emoji emoji-id='5217822164362739968'>🚀</tg-emoji>";57 var EMJ_HEADER_NEW = "<tg-emoji emoji-id='6194809138371904539'>✨</tg-emoji>"; 58 var EMJ_HEADER_SHIELD = "<tg-emoji emoji-id='6113743082358841933'>🔰</tg-emoji>";59 60 // Welcome message ke saare items ke variables:61 var MSG_EMJ_STORE = "<tg-emoji emoji-id='5866053971960929280'>🛒</tg-emoji>";62 var MSG_EMJ_FFID = "<tg-emoji emoji-id='5334890573281114250'>🎮</tg-emoji>"; 63 var MSG_EMJ_PROFILE = "<tg-emoji emoji-id='5260399854500191689'>🔰</tg-emoji>";64 var MSG_EMJ_ADDBAL = "<tg-emoji emoji-id='6147815702163102310'>✨</tg-emoji>";65 var MSG_EMJ_HISTORY = "<tg-emoji emoji-id='6113743082358841933'>🔰</tg-emoji>";66 var MSG_EMJ_LUDO = "<tg-emoji emoji-id='5371043439020353782'>🎲</tg-emoji>"; // Ludo Spin Custom Emoji67 var MSG_EMJ_TUTORIAL = "<tg-emoji emoji-id='5258077307985207053'>📹</tg-emoji>";68 var MSG_EMJ_PROOF = "<tg-emoji emoji-id='5330237710655306682'>✅</tg-emoji>"; // Payment Proof Custom Emoji69 var MSG_EMJ_SUPPORT = "<tg-emoji emoji-id='5436113877181941026'>🔰</tg-emoji>";70 71 // Naye aur Updated Emojis72 var EMJ_PREMIUM_MENU = "<tg-emoji emoji-id='5406745015365943482'>✨</tg-emoji>";73 var EMJ_YOUR_BALANCE = "<tg-emoji emoji-id='5231200819986047254'>💰</tg-emoji>";74 var EMJ_GET_STARTED = "<tg-emoji emoji-id='6057415823222379852'>👇</tg-emoji>";75 76 // 📝 FULL WELCOME MESSAGE — synced with /start design (GALU MODZ STORE PANEL)77 var welcomeMessage =78 "<tg-emoji emoji-id=\"6266967801580231067\">💎</tg-emoji> <tg-emoji emoji-id=\"5866053971960929280\">🏪</tg-emoji> <b>— AMAN SHOP STORE —</b> <tg-emoji emoji-id=\"5866053971960929280\">🏪</tg-emoji> <tg-emoji emoji-id=\"6266967801580231067\">💎</tg-emoji>\n\n" +79 "<tg-emoji emoji-id=\"6093677128295914531\">🎉</tg-emoji> <b>Hello, " + ((user && user.first_name) ? user.first_name.toUpperCase() : "RESELLER") + "!</b>\n\n" +80 "<tg-emoji emoji-id=\"6080228009439141516\">💧</tg-emoji> <b>Genuine, limited-stock books. Instant delivery.</b>\n\n" +81 "<tg-emoji emoji-id=\"6093591495237967001\">🌐</tg-emoji> Wide product catalog\n" +82 "<tg-emoji emoji-id=\"6215386799133433653\">🔑</tg-emoji> Instant delivery on payment\n" +83 "<tg-emoji emoji-id=\"6312263493051489212\">💰</tg-emoji> Multiple payment gateways\n" +84 "<tg-emoji emoji-id=\"6100170496077204999\">👑</tg-emoji> 24/7 admin support\n\n" +85 "<i>Balance: ₹" + userBal + "</i>\n\n" +86 "<i>Tap any button below to begin:</i> " + EMJ_GET_STARTED;87 88 // 🎨 KEYBOARD — same layout as /start89 var multiColorKeyboard = [90 [{ text: "Shop Now", callback_data: "/buy_hack", style: "primary", icon_custom_emoji_id: "5866053971960929280" }],91 [92 { text: "Profile", callback_data: "/profile", style: "primary", icon_custom_emoji_id: "5260399854500191689" },93 { text: "Add Balance", callback_data: "/addfund", style: "success", icon_custom_emoji_id: "6147815702163102310" }94 ],95 [96 { text: "My Keys", callback_data: "/mykey", style: "primary", icon_custom_emoji_id: "6113743082358841933" },97 { text: "How to use", callback_data: "/how", style: "danger", icon_custom_emoji_id: "6080214566191505147" }98 ],99 [100 { text: "Download Files", callback_data: "/download_updates", style: "primary", icon_custom_emoji_id: "5208790878931415568" },101 { text: "Daily Gift", callback_data: "/dailygift", style: "success", icon_custom_emoji_id: "6194922667242429131" }102 ],103 [104 { text: "Refer & Earn", callback_data: "/refer", style: "success", icon_custom_emoji_id: "5823654080584618403" },105 { text: "Support", callback_data: "/support", style: "danger", icon_custom_emoji_id: "5436113877181941026" }106 ],107 [{ text: "Payment Proofs", url: (Bot.getProperty("payment_proof_link") || "https://t.me/GaluModz_Proof"), style: "success", icon_custom_emoji_id: "5330237710655306682" }]108 ];109 110 // 👑 Conditional Reseller Upgrade button111 if (Bot.getProperty("reseller_system_enabled") && !Bot.getProperty("is_reseller_" + userId)) {112 multiColorKeyboard.push([113 { text: "Reseller Upgrade", callback_data: "/reseller_upgrade", style: "success", icon_custom_emoji_id: "6102856637343600044" }114 ]);115 }116 117 // 🔄 Safe Callback Loading Controller118 var queryId = null;119 if (request) {120 if (request.id) { queryId = request.id; }121 else if (request.callback_query && request.callback_query.id) { queryId = request.callback_query.id; }122 }123 124 if (queryId) {125 try { Api.answerCallbackQuery({ callback_query_id: queryId }); } catch(qErr){}126 }127 128 // ⚡ Native Execution Route (Send vs Edit Handler)129 // ✅ BUG FIX: agar previous message ek PHOTO thi (jaise DP-attached Profile),130 // Telegram editMessageText use hi nahi kar sakta uspar — isi wajah se Profile131 // se "Back" click karne par kuch hota hi nahi tha. Ab photo ho to delete karke132 // fresh text message bheja jaata hai.133 if (request && request.message && request.message.message_id) {134 if (request.message.photo) {135 try { Api.deleteMessage({ chat_id: chat.chatid, message_id: request.message.message_id }); } catch (delErr) {}136 Api.sendMessage({137 chat_id: chat.chatid,138 text: welcomeMessage,139 parse_mode: "HTML",140 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })141 });142 } else {143 Api.editMessageText({144 chat_id: chat.chatid,145 message_id: request.message.message_id,146 text: welcomeMessage,147 parse_mode: "HTML",148 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })149 });150 }151 } else {152 Api.sendMessage({153 chat_id: chat.chatid,154 text: welcomeMessage,155 parse_mode: "HTML",156 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })157 });158 }159 160} catch (globalException) {161 Bot.sendMessage("🛑 <b>Dashboard Debug Error:</b> <code>" + globalException.message + "</code>", { parse_mode: "HTML" });162}