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
commands/_cancel_buy.js
javascript · 55 lines
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}