ayushyadav7970824760/goldensellingstore_botPublic · Bot Template

AIThis Telegram store bot lets customers browse digital products and plans, apply coupons, add funds via UPI, and receive purchased keys. It includes a full admin panel for managing products, reordering items, setting reseller prices, viewing and removing key stock, configuring UPI payment details and update links, and checking user balances. Co-admins and resellers are supported, and support tickets are forwarded to the admin.

Commercedigital_storeadmin_panelupi_paymentsresellercouponskey_stock
ProfileTelegram
146 commands0 envUpdated 2d agoCreated Sep 5, 2026
Back to folder

commands/_onQRExpire.js

javascript · 43 lines

Raw
1/**#command2name: /onQRExpire3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var uid = (typeof user !== "undefined" && user) ? String(user.telegramid) : null;14  var cid = (typeof chat !== "undefined" && chat) ? String(chat.chatid) : null;15  if (!uid || !cid) return;16  var now=Date.now(), expiredAny=false;17  var eWarn="6219547832169273793", eTime="6266866272848321043", eBack="5893163582194978381";18  var order=Bot.getProperty("qr_order_id_"+uid)||User.getProperty("qr_order_id_"+uid);19  var watch=Bot.getProperty("qr_watch_order_"+uid)||User.getProperty("qr_watch_order_"+uid);20  var created=Number(Bot.getProperty("qr_created_ts_"+uid)||User.getProperty("qr_created_ts_"+uid)||0);21  if(order&&watch&&String(order)===String(watch)&&(!created||now-created>=295000)){22    var mid=Bot.getProperty("qr_msg_id_"+uid)||User.getProperty("qr_msg_id_"+uid);23    if(mid)try{Api.deleteMessage({chat_id:cid,message_id:Number(mid)});}catch(e){}24    Bot.setProperty("qr_order_id_"+uid,null,"string"); User.setProperty("qr_order_id_"+uid,null,"string");25    Bot.setProperty("qr_watch_order_"+uid,null,"string"); User.setProperty("qr_watch_order_"+uid,null,"string");26    Bot.setProperty("qr_msg_id_"+uid,null,"string"); User.setProperty("qr_msg_id_"+uid,null,"string");27    User.setProperty("pending_order_id",null); expiredAny=true;28  }29  var buyOrder=User.getProperty("buy_pending_order_id");30  var buyWatch=Bot.getProperty("buy_qr_watch_order_"+uid)||User.getProperty("buy_qr_watch_order_"+uid);31  var buyCreated=Number(Bot.getProperty("buy_qr_created_ts_"+uid)||0);32  if(buyOrder&&buyWatch&&String(buyOrder)===String(buyWatch)&&(!buyCreated||now-buyCreated>=295000)){33    var bmid=Bot.getProperty("buy_qr_msg_id_"+uid)||User.getProperty("buy_qr_msg_id_"+uid);34    if(bmid)try{Api.deleteMessage({chat_id:cid,message_id:Number(bmid)});}catch(e){}35    User.setProperty("buy_pending_order_id",null); Bot.setProperty("buy_qr_msg_id_"+uid,null,"string"); User.setProperty("buy_qr_msg_id_"+uid,null,"string");36    Bot.setProperty("buy_qr_watch_order_"+uid,null,"string"); User.setProperty("buy_qr_watch_order_"+uid,null,"string");37 38    expiredAny=true;39  }40  if(expiredAny){41    Api.sendMessage({chat_id:cid,text:"<blockquote><tg-emoji emoji-id='"+eWarn+"'>⏰</tg-emoji> <b>PAYMENT QR EXPIRED</b></blockquote>\n\n<tg-emoji emoji-id='"+eTime+"'>⌛</tg-emoji> <b>Your 5-minute payment session has expired.</b>\n\n<i>The old QR has been removed automatically. Please create a new QR to continue.</i>",parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:[[{text:"💰 Create New Payment",callback_data:"/addfund",style:"success"}],[{text:"Back",callback_data:"/back",style:"danger"}]]})});42  }43} catch(err) { try{Bot.sendMessage("⚠️ <b>QR expiry error:</b> <code>"+err.message+"</code>",{parse_mode:"HTML"});}catch(e){} }