ayushyadav7970824760/goldensellingstore_botPublic · Bot Template

AIThis Telegram store bot lets customers browse digital products and plans, apply coupons, add funds via UPI, and receive purchased keys. It includes a full admin panel for managing products, reordering items, setting reseller prices, viewing and removing key stock, configuring UPI payment details and update links, and checking user balances. Co-admins and resellers are supported, and support tickets are forwarded to the admin.

Commercedigital_storeadmin_panelupi_paymentsresellercouponskey_stock
ProfileTelegram
146 commands0 envUpdated 2d agoCreated Sep 5, 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}