kkapil9112/Aestheticmodes9_botPublic · Bot Template

AIA Telegram-based digital goods store bot with a full admin panel for managing products, plans, stock, keys, categories, resellers, balances, and coupons. It uses TeleBotHost APIs like Bot, Api, User, Libs.ResourcesLib, and HTTP to run a shop interface, handle admin-only commands, track users, and send inventory/balance summaries. The implementation appears focused on selling game-related accounts and keys such as FreeFire items, with customer-facing store, balance, coupon, and back-to-menu flows.

Commerceshopadmin-panelbalanceresellercouponsstock-management
ProfileTelegram
102 commands1 envUpdated 29d agoCreated Aug 9, 2026
Back to folder

commands/_delete_coupon.js

javascript · 39 lines

Raw
1/**#command2name: /delete_coupon3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var ownerId = Bot.getProperty("owner_id") || "8812621370";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  Bot.setProperty("coupon_" + code, null, "json");25 26  var couponList = Bot.getProperty("coupon_list") || [];27  var idx = couponList.indexOf(code);28  if (idx > -1) { couponList.splice(idx, 1); Bot.setProperty("coupon_list", couponList, "json"); }29 30  Bot.sendMessage("🗑 Coupon <code>" + code + "</code> delete ho gaya.", { parse_mode: "HTML" });31 32  Bot.run({ command: "/coupons" });33 34  var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;35  if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {} }36 37} catch (err) {38  Bot.sendMessage("⚠️ Error: " + err.message);39}