mansuriamaan803/SANJEEVFFSTORE_botPublic · Bot Template

AIThis bot is a commerce platform for selling digital products, primarily focused on FreeFire accounts and related services. It provides admin tools for managing products, categories, stock, reseller roles, and a balance system for user payments. Users can browse products, apply coupons, and check their balance through an interactive interface with premium emojis and inline keyboards.

Commercecommercestoreproductsresellerbalancecoupon
ProfileTelegram
102 commands0 envUpdated 12d agoCreated Aug 26, 2026
Back to folder

commands/_pause_coupon.js

javascript · 36 lines

Raw
1/**#command2name: /pause_coupon3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var ownerId = Bot.getProperty("owner_id") || "8963001413";14  var isCoAdmin = Bot.getProperty("co_admin_" + String(chat.chatid));15  if (String(chat.chatid) !== ownerId && !isCoAdmin) { return; }16 17  var code = params ? String(params).trim().toUpperCase() : "";18  var c = Bot.getProperty("coupon_" + code);19  if (!c) {20    Bot.sendMessage("❌ Coupon not found.");21    return;22  }23 24  c.isPaused = !c.isPaused;25  Bot.setProperty("coupon_" + code, c, "json");26 27  Bot.sendMessage("✅ Coupon <code>" + code + "</code> ab " + (c.isPaused ? "⏸ Paused" : "✅ Active") + " hai.", { parse_mode: "HTML" });28 29  Bot.run({ command: "/coupons" });30 31  var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;32  if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {} }33 34} catch (err) {35  Bot.sendMessage("⚠️ Error: " + err.message);36}