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

javascript · 45 lines

Raw
1/**#command2name: /onQRExpire3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var opts = (typeof options !== "undefined" && options) ? options : {};14  var userId = opts.userId || (typeof user !== "undefined" && user ? user.telegramid : null);15  var chatId = opts.chatId || (typeof chat !== "undefined" && chat ? chat.chatid : null);16 17  if (!userId || !chatId) { return; }18 19  var activeOrder = Bot.getProperty("qr_order_id_" + userId) || User.getProperty("qr_order_id_" + userId);20  var watchOrder = Bot.getProperty("qr_watch_order_" + userId) || User.getProperty("qr_watch_order_" + userId);21  var qrMsgId = Bot.getProperty("qr_msg_id_" + userId) || User.getProperty("qr_msg_id_" + userId);22 23  // ✅ Agar order already paid/cancelled ho chuka hai (activeOrder null ya watchOrder se alag), kuch mat karo24  if (!activeOrder || !watchOrder || String(activeOrder) !== String(watchOrder)) {25    return;26  }27 28  // ✅ UPDATED: ab koi "Order Expired" message nahi bheja jaata — QR bas29  // chupchaap vanish (delete) ho jaata hai jaise request kiya gaya tha.30  if (qrMsgId) {31    try { Api.deleteMessage({ chat_id: chatId, message_id: Number(qrMsgId) }); } catch (delErr) {}32  }33 34  // 🧹 Cleanup — order ab dead hai35  Bot.setProperty("qr_order_id_" + userId, null, "string");36  User.setProperty("qr_order_id_" + userId, null, "string");37  Bot.setProperty("qr_watch_order_" + userId, null, "string");38  User.setProperty("qr_watch_order_" + userId, null, "string");39  User.setProperty("pending_order_id", null);40  Bot.setProperty("verifying_lock_" + userId, false, "boolean");41  User.setProperty("verifying_lock_" + userId, false, "boolean");42 43} catch (err) {44  Bot.sendMessage("⚠️ Expiry Watcher Error: " + err.message);45}