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/_apply_coupon.js
javascript · 50 lines
1/**#command2name: /apply_coupon3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// ⭐ USER — "Apply Coupon Code" button handler14// Prompts the user for a coupon code; _start.js MODULE 4 handles the reply.15// =========================================================16 17try {18 var parts = params ? String(params).trim().split(" ") : [];19 var prodIdx = parts[0];20 var planIdx = parts[1];21 22 User.setProperty("awaiting_coupon_for", prodIdx + " " + planIdx, "string");23 24 var text =25 "<blockquote><tg-emoji emoji-id='6093677128295914531'>🎫</tg-emoji> <b>APPLY COUPON CODE</b></blockquote>\n\n" +26 "<i>Apna coupon code type karke bhejein...</i>";27 28 if (request && request.message) {29 try {30 Api.editMessageText({31 chat_id: String(chat.chatid),32 message_id: Number(request.message.message_id),33 text: text,34 parse_mode: "HTML"35 });36 } catch (e) {37 Api.sendMessage({ chat_id: chat.chatid, text: text, parse_mode: "HTML" });38 }39 } else {40 Api.sendMessage({ chat_id: chat.chatid, text: text, parse_mode: "HTML" });41 }42 43 var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;44 if (queryId) {45 try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {}46 }47 48} catch (err) {49 Bot.sendMessage("⚠️ Error: " + err.message);50}