kkapil9112/Aestheticmodes9_botPublic · Bot Template
AIA Telegram-based digital goods store bot with a full admin panel for managing products, plans, stock, keys, categories, resellers, balances, and coupons. It uses TeleBotHost APIs like Bot, Api, User, Libs.ResourcesLib, and HTTP to run a shop interface, handle admin-only commands, track users, and send inventory/balance summaries. The implementation appears focused on selling game-related accounts and keys such as FreeFire items, with customer-facing store, balance, coupon, and back-to-menu flows.
Commerceshopadmin-panelbalanceresellercouponsstock-management
102 commands1 envUpdated 29d agoCreated Aug 9, 2026
commands/_buy_hack.js
javascript · 109 lines
1/**#command2name: /buy_hack3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🛒 SHOP MENU — Product listing (entry point of the whole buy flow)14// ✅ BUG FIX: reply_markup pehle raw object bheja jaa raha tha (JSON.stringify15// missing) — is wajah se product buttons kabhi kabhi properly render/work16// nahi karte the, jisse poora buy flow shuru hone se pehle hi tootta tha.17// ✅ BUG FIX: photo-message (jaise Profile) se yahan aane par editMessageText18// fail ho jaata — ab photo detect hoke delete + fresh send hota hai.19// ✅ Premium redesign.20// =========================================================21 22try {23 var rawData = Bot.getProperty("stored_products");24 var productList = [];25 26 if (Array.isArray(rawData)) {27 productList = rawData;28 } else if (typeof rawData === "string") {29 try {30 productList = JSON.parse(rawData);31 if (!Array.isArray(productList)) { productList = []; }32 } catch (e) {33 productList = [];34 }35 }36 37 // Agar list bilkul khali hai toh ek default product dal do taaki store khali na dikhe38 if (productList.length === 0) {39 productList.push({40 name: "Drip Client (Non Root)",41 emoji: "5226656353744862682",42 id: "1",43 plans: []44 });45 Bot.setProperty("stored_products", productList, "json");46 }47 48 var chatId = chat.chatid;49 var firstName = user && user.first_name ? user.first_name : "User";50 var productButtons = [];51 52 for (var i = 0; i < productList.length; i++) {53 var item = productList[i];54 var itemName = (item && item.name) ? String(item.name) : "Product " + (i + 1);55 var itemEmoji = (item && item.emoji) ? String(item.emoji) : "5226656353744862682";56 var stockBadge = "";57 58 productButtons.push([59 {60 text: itemName,61 callback_data: "/viewprod " + i,62 style: "primary",63 icon_custom_emoji_id: itemEmoji64 }65 ]);66 }67 68 productButtons.push([69 {70 text: "Back to Menu",71 callback_data: "/back",72 style: "danger",73 icon_custom_emoji_id: "5893163582194978381"74 }75 ]);76 77 var storeText =78 "<blockquote>🛒 <b>SELECT A PRODUCT</b> ✨</blockquote>\n" +79 "━━━━━━━━━━━━━━━━━━━━━\n\n" +80 "<tg-emoji emoji-id='6091571559233755994'>👋</tg-emoji> <b>Yoo " + firstName + "!</b>\n" +81 "<i>Choose any product below to view its price and available duration plans.</i>\n" +82 "━━━━━━━━━━━━━━━━━━━━━";83 84 var replyMarkupStr = JSON.stringify({ inline_keyboard: productButtons });85 86 if (request && request.message && request.message.message_id) {87 if (request.message.photo) {88 try { Api.deleteMessage({ chat_id: chatId, message_id: request.message.message_id }); } catch (e) {}89 Api.sendMessage({ chat_id: chatId, text: storeText, parse_mode: "HTML", reply_markup: replyMarkupStr });90 } else {91 Api.editMessageText({92 chat_id: chatId,93 message_id: request.message.message_id,94 text: storeText,95 parse_mode: "HTML",96 reply_markup: replyMarkupStr97 });98 }99 } else {100 Api.sendMessage({ chat_id: chatId, text: storeText, parse_mode: "HTML", reply_markup: replyMarkupStr });101 }102 103 if (request && request.id) {104 try { Api.answerCallbackQuery({ callback_query_id: request.id }); } catch (e) {}105 }106 107} catch (err) {108 Bot.sendMessage("⚠️ Shop Menu Error: " + err.message, { parse_mode: "HTML" });109}