pnxh2371/Ankit_mods_store_botPublic ยท Bot Template

ProfileTelegram

AI๐€ษดแด‹ษชแด› ๐Œแดแด…๊œฑ ๐’แด›แดส€แด‡ ๐Ÿ› appears to be a Telegram automation bot. Commands include /*, /addbal, /addbal_all, /addbal_binance, /addbal_binance_approve, /addbal_binance_paid, /addbal_upi, /addcat_id. Observed in code: messaging, http, libs, keyboards, payments.

Utilityutility
133 commands0 envUpdated 7h agoCreated Sep 10, 2026
Back to folder

commands/_coupons.js

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