kkapil9112/Hguuuuuv45botPublic · Bot Template

AITelegram commerce bot for an admin-managed digital store: admins create categories, products, time-based plans, stock entries and license keys, and can grant reseller roles or adjust user balances. End users can view their balance, start a deposit flow with an inline amount keypad, apply coupon codes, and navigate back to the store menu. It uses Bot properties for product/stock/coupon data and Libs.ResourcesLib for per-user balances.

Commercecommerceshopreselleradmin-panelbalanceproduct-management
ProfileTelegram
102 commands0 envUpdated 29d agoCreated Aug 7, 2026
Back to folder

commands/_gencoupon.js

javascript · 35 lines

Raw
1/**#command2name: /gencoupon3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🎟 ADMIN — Coupon Generator Wizard (Step 1: kicks off in _start.js MODULE 3)14// =========================================================15 16try {17  var adminId = Bot.getProperty("owner_id") || "8812621370";18  var isCoAdmin0 = Bot.getProperty("co_admin_" + String(chat.chatid));19  if (String(chat.chatid) !== adminId && !isCoAdmin0) {20    Bot.sendMessage("❌ You are not the admin!");21    return;22  }23 24  User.setProperty("coupon_gen_step", "code", "string");25 26  Bot.sendMessage(27    "<blockquote>🎟 <b>COUPON GENERATOR</b></blockquote>\n\n" +28    "<tg-emoji emoji-id='6080214566191505147'>🏷</tg-emoji> <b>Coupon code kya rakhna hai?</b>\n" +29    "<i>Type karke bhejein, jaise: SAVE10</i>",30    { parse_mode: "HTML" }31  );32 33} catch (err) {34  Bot.sendMessage("⚠️ Error: " + err.message);35}