devbro468/Dev_x_store_botPublic · Bot Template

AIThis bot operates a digital storefront (DEV X STORE) selling subscription-based products — likely game hacks, accounts, or access keys — categorized by platform (Android Root, Non-Root, iPhone). It features a reseller program with discounted pricing, a dual-currency wallet (INR balance + Telegram Stars/XTR), and a full admin/co-admin panel for managing products, plans, per-plan pricing, stock (keys/accounts), coupons, and API endpoints. Purchases flow through a plan selection screen offering wallet payment, Stars invoices (sendInvoice with XTR currency), and coupon application. Successful Stars payments are handled via successful_payment webhook, crediting wallet or delivering keys directly. Admin tools include user listing with chunked messaging, stock viewing/deletion with inline keyboards, co-admin management, and API registry updates. The bot registers users on first interaction and

Commercecommercedigital-goodsstars-paymentreseller-systemadmin-panelstock-management
ProfileTelegram
119 commands0 envUpdated 15d agoCreated Aug 23, 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}