indrajitghosh20006/Testseller_01botPublic · Bot Template

ProfileTelegram

AIThis bot provides an admin‑controlled system for managing user balances, products, and reseller roles. It includes commands to add balances (via manual input, Binance Pay, or UPI), approve and credit payments, and set up product listings with categories and pricing. Admins can also add resellers, view reseller info, and manage stock entries. The bot uses built‑in TeleBotHost APIs such as Bot, Api, HTTP, and Libs for database operations and message handling.

Commerceadminbalanceproductresellerpaymentsbinance
138 commands0 envUpdated 17h agoCreated Sep 27, 2026
Back to folder

commands/_cancel_buy.js

javascript · 55 lines

Raw
1/**#command2name: /cancel_buy3answer: 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("buy_qr_msg_id_" + userId) || User.getProperty("buy_qr_msg_id_" + userId);17 18  if (qrMsgId) {19    try { Api.deleteMessage({ chat_id: chat.chatid, message_id: qrMsgId }); } catch (e) {}20  }21 22  User.setProperty("buy_pending_order_id", null);23  User.setProperty("buy_prod_idx", null);24  User.setProperty("buy_plan_idx", null);25  User.setProperty("buy_price", null);26  User.setProperty("buy_needpay", null);27  User.setProperty("buy_prod_name", null);28  User.setProperty("buy_plan_days", null);29  Bot.setProperty("buy_qr_msg_id_" + userId, null, "string");30  User.setProperty("buy_qr_msg_id_" + userId, null, "string");31 32  var cancelText = "<blockquote>" +33    "<tg-emoji emoji-id='6219547832169273793'>❌</tg-emoji> <b>ORDER CANCELLED</b>\n" +34    "━━━━━━━━━━━━━━━━━━━━━\n" +35    "<tg-emoji emoji-id='6266994443262367483'>😊</tg-emoji> <i>Koi baat nahi, jab chaho phir se shop se buy kar sakte ho.</i>" +36    "</blockquote>";37 38  Api.sendMessage({39    chat_id: chat.chatid,40    text: cancelText,41    parse_mode: "HTML",42    reply_markup: JSON.stringify({43      inline_keyboard: [[44        { text: "Shop Menu", callback_data: "/buy_hack", style: "primary", icon_custom_emoji_id: "6057415823222379852" }45      ]]46    })47  });48 49  if (callbackId) {50    Api.answerCallbackQuery({ callback_query_id: String(callbackId) });51  }52 53} catch (err) {54  Bot.sendMessage("⚠️ System Error: " + err.message);55}