ashoksarande3/ASHOK_HACK_STORE_BOTPublic ยท Bot Template
AIThis bot operates as a commercial storefront for selling Free Fire game hacks and cheats via UPI QR code payments. It features a dynamic pricing system with separate normal and reseller prices, product plans with flexible durations (days, hours, minutes), and a reseller program requiring a one-time upgrade fee. The bot handles payment verification through QR code generation and expiry tracking, user verification via Telegram contact sharing, and admin tools for stock management, plan creation, and ownership transfer. It includes a balance system, maintenance mode, and Telegram Stars payment fallback. The codebase uses TeleBotHost's TBL JavaScript APIs (Bot, Api, HTTP, db properties, Libs) for all logic.
commands/_back.js
javascript ยท 155 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 (ASHOK PAINL STORE PANEL)77 var welcomeMessage =78 "<tg-emoji emoji-id=\"6266967801580231067\">๐</tg-emoji> <tg-emoji emoji-id=\"5866053971960929280\">๐ช</tg-emoji> <b>โ ASHOK PAINL STORE PANEL โ</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 [{ text: "Payment Proofs", url: "https://t.me/GaluModz_Proof", style: "success", icon_custom_emoji_id: "5330237710655306682" }],100 [{ text: "Support", callback_data: "/support", style: "danger", icon_custom_emoji_id: "5436113877181941026" }]101 ];102 103 // ๐ Conditional Reseller Upgrade button104 if (Bot.getProperty("reseller_system_enabled") && !Bot.getProperty("is_reseller_" + userId)) {105 multiColorKeyboard.push([106 { text: "Reseller Upgrade", callback_data: "/reseller_upgrade", style: "success", icon_custom_emoji_id: "6102856637343600044" }107 ]);108 }109 110 // ๐ Safe Callback Loading Controller111 var queryId = null;112 if (request) {113 if (request.id) { queryId = request.id; }114 else if (request.callback_query && request.callback_query.id) { queryId = request.callback_query.id; }115 }116 117 if (queryId) {118 try { Api.answerCallbackQuery({ callback_query_id: queryId }); } catch(qErr){}119 }120 121 // โก Native Execution Route (Send vs Edit Handler)122 // โ
BUG FIX: agar previous message ek PHOTO thi (jaise DP-attached Profile),123 // Telegram editMessageText use hi nahi kar sakta uspar โ isi wajah se Profile124 // se "Back" click karne par kuch hota hi nahi tha. Ab photo ho to delete karke125 // fresh text message bheja jaata hai.126 if (request && request.message && request.message.message_id) {127 if (request.message.photo) {128 try { Api.deleteMessage({ chat_id: chat.chatid, message_id: request.message.message_id }); } catch (delErr) {}129 Api.sendMessage({130 chat_id: chat.chatid,131 text: welcomeMessage,132 parse_mode: "HTML",133 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })134 });135 } else {136 Api.editMessageText({137 chat_id: chat.chatid,138 message_id: request.message.message_id,139 text: welcomeMessage,140 parse_mode: "HTML",141 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })142 });143 }144 } else {145 Api.sendMessage({146 chat_id: chat.chatid,147 text: welcomeMessage,148 parse_mode: "HTML",149 reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard })150 });151 }152 153} catch (globalException) {154 Bot.sendMessage("๐ <b>Dashboard Debug Error:</b> <code>" + globalException.message + "</code>", { parse_mode: "HTML" });155}