tvdevo30301/nemo_13_shopbotPublic ยท Bot Template

ProfileTelegram

AINEMO_SHOP๐Ÿ›’ appears to be a Telegram automation bot. Commands include /*, /addbal, /addcat_id, /addfund, /addkey, /addplan, /addproduct, /addreseller. Observed in code: messaging, http, libs, keyboards, payments.

Utilityutility
102 commands1 envUpdated 23d agoCreated Oct 7, 2026
Back to folder

commands/_coupons.js

javascript ยท 64 lines

Raw
1/**#command2name: /coupons3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// ๐ŸŽŸ ADMIN/CO-ADMIN โ€” View all coupons with usage stats + Pause/Resume/Delete14// =========================================================15 16try {17  var ownerId = Bot.getProperty("owner_id") || "8812621370";18  var isCoAdmin = Bot.getProperty("co_admin_" + String(chat.chatid));19  if (String(chat.chatid) !== ownerId && !isCoAdmin) {20    Bot.sendMessage("โŒ Restricted command!");21    return;22  }23 24  var couponList = Bot.getProperty("coupon_list") || [];25 26  if (couponList.length === 0) {27    Bot.sendMessage("<blockquote>๐ŸŽŸ <b>No coupons created yet.</b>\n<i>Use /gencoupon to create one.</i></blockquote>", { parse_mode: "HTML" });28    return;29  }30 31  var text = "<blockquote>๐ŸŽŸ <b>ALL COUPONS</b></blockquote>\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\n";32  var buttons = [];33 34  for (var i = 0; i < couponList.length; i++) {35    var code = couponList[i];36    var c = Bot.getProperty("coupon_" + code);37    if (!c) continue;38 39    var claimedCount = Array.isArray(c.claimedBy) ? c.claimedBy.length : 0;40    var statusLabel = c.isPaused ? "โธ Paused" : "โœ… Active";41    var scopeLabel = c.scope === "global" ? "๐ŸŒ Global" : "๐Ÿ“ฆ " + (c.productName || "?") + " (" + (c.duration || "?") + ")";42 43    text += "๐Ÿท <b>" + code + "</b> โ€” " + statusLabel + "\n" +44            "๐Ÿ’ธ " + c.discountPercent + "% off | ๐Ÿ‘ฅ " + claimedCount + "/" + c.maxClaims + " claimed\n" +45            scopeLabel + "\n\n";46 47    buttons.push([48      { text: (c.isPaused ? "โ–ถ Resume" : "โธ Pause") + " " + code, callback_data: "/pause_coupon " + code, style: c.isPaused ? "success" : "primary" },49      { text: "๐Ÿ—‘ Delete " + code, callback_data: "/delete_coupon " + code, style: "danger" }50    ]);51  }52 53  buttons.push([{ text: "Back to Admin Panel", callback_data: "/admin", style: "primary", icon_custom_emoji_id: "5893163582194978381" }]);54 55  Api.sendMessage({56    chat_id: chat.chatid,57    text: text,58    parse_mode: "HTML",59    reply_markup: JSON.stringify({ inline_keyboard: buttons })60  });61 62} catch (err) {63  Bot.sendMessage("โš ๏ธ Error: " + err.message);64}