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
ProfileTelegram
102 commands1 envUpdated 29d agoCreated Aug 9, 2026
Back to folder

commands/_apply_coupon.js

javascript · 50 lines

Raw
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}