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/_cancel_topup.js

javascript · 61 lines

Raw
1/**#command2name: /cancel_topup3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var userId = user.telegramid;14  var callbackId = request ? request.id : (request.callback_query && request.callback_query.id);15 16  var qrMsgId = Bot.getProperty("qr_msg_id_" + userId) || User.getProperty("qr_msg_id_" + userId) || (request.message ? request.message.message_id : null);17 18  if (qrMsgId) {19    try { Api.deleteMessage({ chat_id: chat.chatid, message_id: qrMsgId }); } catch (e) {}20  }21 22  User.setProperty("pending_order_id", null);23  User.setProperty("deposit_amount", "0", "string");24  Bot.setProperty("qr_msg_id_" + userId, null, "string");25  User.setProperty("qr_msg_id_" + userId, null, "string");26  Bot.setProperty("qr_caption_" + userId, null, "string");27  User.setProperty("qr_caption_" + userId, null, "string");28  Bot.setProperty("qr_buttons_" + userId, null, "string");29  User.setProperty("qr_buttons_" + userId, null, "string");30  Bot.setProperty("qr_order_id_" + userId, null, "string");31  User.setProperty("qr_order_id_" + userId, null, "string");32 33  // ✅ Expiry-watcher ko disable karo taaki baad mein galat message edit na ho34  Bot.setProperty("qr_watch_order_" + userId, null, "string");35  User.setProperty("qr_watch_order_" + userId, null, "string");36  Bot.setProperty("verifying_lock_" + userId, false, "boolean");37  User.setProperty("verifying_lock_" + userId, false, "boolean");38 39  var cancelText = "<blockquote>" +40    "<tg-emoji emoji-id='6219547832169273793'>❌</tg-emoji> <b>Order Cancelled</b>\n" +41    "<tg-emoji emoji-id='6266994443262367483'>😊</tg-emoji> <i>Koi baat nahi, jab chaho phir se wallet me balance add kar sakte ho.</i>" +42    "</blockquote>";43 44  Api.sendMessage({45    chat_id: chat.chatid,46    text: cancelText,47    parse_mode: "HTML",48    reply_markup: JSON.stringify({49      inline_keyboard: [[50        { text: "Back to Menu", callback_data: "/back", style: "primary", icon_custom_emoji_id: "6057415823222379852" }51      ]]52    })53  });54 55  if (callbackId) {56    Api.answerCallbackQuery({ callback_query_id: String(callbackId) });57  }58 59} catch (err) {60  Bot.sendMessage("⚠️ System Error: " + err.message);61}