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/_press.js
javascript · 157 lines
1/**#command2name: /press3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// Command Name: /press (Premium Calculator Keypad Handler)13// ✅ FIXED: "Back" button pehle "/dmenu" call kar raha tha jo bot me exist hi nahi karta14// (dead button — click karne par kuch nahi hota tha). Ab "/back" (real menu command) use hota hai.15// ✅ Number buttons ab addfund screen jaisi hi blue "primary" styling ke saath hain (pehle plain/colorless the).16 17try {18 // Purana set default check: Agar user ne naya deposit shuru kiya hai toh default 0 rahe19 let current_amount = User.getProperty("deposit_amount");20 if (!current_amount) {21 current_amount = "0";22 }23 24 let pressed = params ? params.trim() : "";25 let queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;26 27 // 💎 Premium Emoji Set (same IDs as /addfund — keeps the screen visually identical, no flicker)28 let e_money = "<tg-emoji emoji-id='6312263493051489212'>💰</tg-emoji>";29 let e_clear = "<tg-emoji emoji-id='5348224471050238603'>✏</tg-emoji>";30 let e_confirm = "<tg-emoji emoji-id='5348191451341668809'>✅</tg-emoji>";31 let e_back = "<tg-emoji emoji-id='5893163582194978381'>⬅️</tg-emoji>";32 let e_hour = "<tg-emoji emoji-id='6100657257605763582'>✔️</tg-emoji>";33 let e_check = "<tg-emoji emoji-id='6311870645277825763'>✔️</tg-emoji>";34 let e_gear = "<tg-emoji emoji-id='5348292765325212780'>⚙</tg-emoji>";35 36 // --- CONFIRM BUTTON CLICK ---37 if (pressed == "confirm") {38 if (parseInt(current_amount) <= 0 || current_amount == "" || current_amount == "0") {39 if (queryId) {40 Api.answerCallbackQuery({41 callback_query_id: queryId,42 text: "👀 PLEASE ENTER A VALID AMOUNT!",43 show_alert: true44 });45 }46 return;47 }48 49 // ✅ NEW: ab seedhe QR generate nahi hota — pehle "Choose Payment Method"50 // Payment method screen — UPI only.51 let finalAmount = String(parseInt(current_amount));52 53 let e_upi = "<tg-emoji emoji-id='5348392971207194994'>💳</tg-emoji>";54 55 let methodText =56 "<blockquote>" + e_money + " <b>CHOOSE PAYMENT METHOD</b></blockquote>\n" +57 "━━━━━━━━━━━━━━━━━━━━━\n\n" +58 e_money + " <b>Amount:</b> ₹<code>" + finalAmount + "</code>\n\n" +59 "━━━━━━━━━━━━━━━━━━━━━\n" +60 "<i>Select a payment gateway below:</i>";61 62 let methodButtons = [63 [{ text: "UPI Pay ₹" + finalAmount, callback_data: "/addbal_upi " + finalAmount, style: "success", icon_custom_emoji_id: "5348392971207194994" }],64 [{ text: "Back", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }]65 ];66 67 Api.editMessageText({68 chat_id: chat.chatid,69 message_id: request.message.message_id,70 text: methodText,71 parse_mode: "HTML",72 reply_markup: JSON.stringify({ inline_keyboard: methodButtons })73 });74 75 // Amount reset to 0 so next time it starts fresh76 User.setProperty("deposit_amount", "0", "string");77 78 if (queryId) {79 Api.answerCallbackQuery({ callback_query_id: queryId });80 }81 82 return;83 }84 85 // --- KEYPAD INPUT LOGIC ---86 if (pressed == "clear") {87 if (current_amount.length > 1) {88 current_amount = current_amount.slice(0, -1);89 } else {90 current_amount = "0";91 }92 } else if (pressed !== "") {93 if (current_amount == "0") {94 current_amount = pressed;95 } else {96 if ((current_amount + pressed).length <= 6) {97 current_amount = current_amount + pressed;98 }99 }100 }101 102 // Save current keypad amount state103 User.setProperty("deposit_amount", current_amount, "string");104 105 if (queryId) {106 Api.answerCallbackQuery({ callback_query_id: queryId });107 }108 109 // 🎨 Keypad Buttons — same premium colored styling as /addfund110 let inlineKeyboardPayload = [111 [112 { text: "1", callback_data: "/press 1", style: "primary" },113 { text: "2", callback_data: "/press 2", style: "primary" },114 { text: "3", callback_data: "/press 3", style: "primary" }115 ],116 [117 { text: "4", callback_data: "/press 4", style: "primary" },118 { text: "5", callback_data: "/press 5", style: "primary" },119 { text: "6", callback_data: "/press 6", style: "primary" }120 ],121 [122 { text: "7", callback_data: "/press 7", style: "primary" },123 { text: "8", callback_data: "/press 8", style: "primary" },124 { text: "9", callback_data: "/press 9", style: "primary" }125 ],126 [127 { text: "Clear", callback_data: "/press clear", style: "danger", icon_custom_emoji_id: "5348224471050238603" },128 { text: "0", callback_data: "/press 0", style: "primary" },129 { text: "Confirm", callback_data: "/press confirm", style: "success", icon_custom_emoji_id: "5348191451341668809" }130 ],131 [132 // ✅ FIXED: "/dmenu" -> "/back" (dead command replaced with the real menu handler)133 { text: "Back", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }134 ]135 ];136 137 let keypadMsg =138 "<blockquote>" + e_money + " <b>ADD BALANCE — ENTER AMOUNT</b> <tg-emoji emoji-id='6312263493051489212'>💎</tg-emoji></blockquote>\n" +139 "━━━━━━━━━━━━━━━━━━━━━\n\n" +140 "<tg-emoji emoji-id='6312263493051489212'>💎</tg-emoji> <b>Amount:</b> ₹<code>" + current_amount + "</code>\n\n" +141 "━━━━━━━━━━━━━━━━━━━━━\n" +142 e_check + " <i>Instant Auto-Credit</i>\n" +143 "<tg-emoji emoji-id='6215386799133433653'>🔒</tg-emoji> <i>100% Secure UPI Payment</i>\n" +144 e_hour + " <i>Verified in Seconds</i>\n\n" +145 "<tg-emoji emoji-id='6100170496077204999'>👑</tg-emoji> <i>Use the keypad below to enter amount</i>";146 147 Api.editMessageText({148 chat_id: chat.chatid,149 message_id: request.message.message_id,150 text: keypadMsg,151 parse_mode: "HTML",152 reply_markup: JSON.stringify({ inline_keyboard: inlineKeyboardPayload })153 });154 155} catch (err) {156 Bot.sendMessage("⚠️ System Error in Keypad: " + err.message);157}