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/_ff_id_menu.js
javascript ยท 135 lines
1/**#command2name: /ff_id_menu3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13 14 // Answer Callback safely15 if (request && request.id) {16 try {17 Api.answerCallbackQuery({ callback_query_id: request.id });18 } catch (e) {}19 } else if (request && request.callback_query && request.callback_query.id) {20 try {21 Api.answerCallbackQuery({ callback_query_id: request.callback_query.id });22 } catch (e) {}23 }24 25 // Safe Chat ID Selection26 var targetChatId = (chat && chat.chatid) ? chat.chatid : ((chat && chat.id) ? chat.id : user.telegramid);27 28 var categories = Bot.getProperty("ff_categories") || {};29 var inlineButtons = [];30 var hasCategories = false;31 32 for (var slug in categories) {33 if (!categories.hasOwnProperty(slug)) continue;34 35 hasCategories = true;36 37 var item = categories[slug];38 var stock = Bot.getProperty("ff_stock_" + slug) || [];39 40 if (!Array.isArray(stock)) stock = [];41 42 var buttonText = item.name;43 var buttonStyle = "primary"; // Default Blue Color44 45 if (stock.length === 0) {46 buttonText += " [OUT OF STOCK]";47 buttonStyle = "danger"; // Native Red Color48 } else {49 buttonText += " [Stock: " + stock.length + "]";50 buttonStyle = "success"; // Native Green Color51 }52 53 // Dynamic Emoji ID: Admin jo ID save karega, exact wahi inject hogi.54 var adminPremiumEmojiId = item.emoji_id || "5334890573281114250";55 56 inlineButtons.push([57 {58 text: buttonText,59 callback_data: "/select_id_product " + slug,60 style: buttonStyle, 61 icon_custom_emoji_id: adminPremiumEmojiId 62 }63 ]);64 }65 66 // Agar categories na ho toh Danger (Red) Button67 if (!hasCategories) {68 inlineButtons.push([69 {70 text: "โ ๏ธ No Platforms Active",71 callback_data: "/back",72 style: "danger"73 }74 ]);75 }76 77 // โ
UPDATED: Back button styled to Primary (Blue) with your specific Premium Emoji ID78 inlineButtons.push([79 {80 text: "Back to Dashboard",81 callback_data: "/back",82 style: "primary",83 icon_custom_emoji_id: "5893163582194978381"84 }85 ]);86 87 // ๐ Live stats footer88 var totalCategories = 0;89 var totalStockAll = 0;90 for (var s in categories) {91 if (!categories.hasOwnProperty(s)) continue;92 totalCategories++;93 var st = Bot.getProperty("ff_stock_" + s) || [];94 if (Array.isArray(st)) totalStockAll += st.length;95 }96 97 var text =98 "<blockquote><b><tg-emoji emoji-id='6080228009439141516'>๐ฎ</tg-emoji> FF ID STORE โ SELECT A PLATFORM <tg-emoji emoji-id='6093854128193152827'>๐ฅ</tg-emoji></b>\n\n" +99 "<i>Browse our available categories below. Instant delivery, verified accounts.</i></blockquote>\n" +100 "โโโโโโโโโโโโโโโโโโโโโ\n" +101 "<tg-emoji emoji-id='6080214566191505147'>๐ฆ</tg-emoji> <b>Categories:</b> <code>" + totalCategories + "</code> " +102 "<tg-emoji emoji-id='6091571559233755994'>๐ฅ</tg-emoji> <b>Total Stock:</b> <code>" + totalStockAll + " accounts</code>\n" +103 "โโโโโโโโโโโโโโโโโโโโโ";104 105 var targetMessageId = (request && request.message) ? request.message.message_id : null;106 107 var replyMarkupObj = {108 inline_keyboard: inlineButtons109 };110 111 if (targetMessageId) {112 Api.editMessageText({113 chat_id: targetChatId,114 message_id: targetMessageId,115 text: text,116 parse_mode: "HTML",117 reply_markup: JSON.stringify(replyMarkupObj)118 });119 } else {120 Api.sendMessage({121 chat_id: targetChatId,122 text: text,123 parse_mode: "HTML",124 reply_markup: JSON.stringify(replyMarkupObj)125 });126 }127 128} catch (e) {129 var errorChatId = (chat && chat.chatid) ? chat.chatid : user.telegramid;130 Api.sendMessage({131 chat_id: errorChatId,132 text: "โ Error structure:\n<code>" + e.message + "</code>",133 parse_mode: "HTML"134 });135}