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/_set_payment_upi.js
javascript · 66 lines
1/**#command2name: /set_payment_upi3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🔧 ADMIN — Configure the UPI ID used for all payment QR codes14// Usage: /set_payment_upi yourid@fam15// =========================================================16 17try {18 var adminId = Bot.getProperty("owner_id") || "8875810358";19 var isCoAdmin0 = Bot.getProperty("co_admin_" + String(chat.chatid));20 if (String(chat.chatid) !== adminId && !isCoAdmin0) {21 Bot.sendMessage("❌ You are not the admin!");22 return;23 }24 25 if (!params || params.trim() === "") {26 var currentUpi0 = Bot.getProperty("payment_upi_id") || "galureang@fam (default)";27 var currentKey0 = Bot.getProperty("payment_api_key");28 var currentKeyDisplay0 = currentKey0 ? (currentKey0.substring(0, 10) + "••••••••") : "FAM_b47c7d••••• (default)";29 Bot.sendMessage(30 "⚠️ <b>Format:</b> <code>/set_payment_upi yourid@fam|FAM_xxxx</code>\n" +31 "<i>(sirf UPI change karna ho to:</i> <code>/set_payment_upi yourid@fam</code><i>)</i>\n\n" +32 "<b>Current UPI ID:</b> <code>" + currentUpi0 + "</code>\n" +33 "<b>Current API Key:</b> <code>" + currentKeyDisplay0 + "</code>",34 { parse_mode: "HTML" }35 );36 return;37 }38 39 var rawInput = params.trim();40 var inputParts = rawInput.split("|");41 var newUpi = inputParts[0].trim();42 var newApiKey = (inputParts.length > 1) ? inputParts[1].trim() : null;43 44 if (newUpi.indexOf("@") === -1 || newUpi.indexOf(" ") !== -1) {45 Bot.sendMessage("❌ Invalid UPI ID! Format jaisa hona chahiye: <code>name@bank</code>", { parse_mode: "HTML" });46 return;47 }48 if (newApiKey !== null && (newApiKey === "" || newApiKey.indexOf(" ") !== -1)) {49 Bot.sendMessage("❌ Invalid API Key! Space allowed nahi hai.", { parse_mode: "HTML" });50 return;51 }52 53 Bot.setProperty("payment_upi_id", newUpi, "string");54 var confirmMsg = "✅ <b>Payment config update ho gaya:</b>\n• UPI ID: <code>" + newUpi + "</code>";55 56 if (newApiKey) {57 Bot.setProperty("payment_api_key", newApiKey, "string");58 confirmMsg += "\n• Fam Pay API Key: <code>" + newApiKey.substring(0, 10) + "••••••••</code>";59 }60 61 confirmMsg += "\n\n<i>Ab saare QR generate + payment verify isi UPI/API se honge, koi bhi purana flow break nahi hoga.</i>";62 Bot.sendMessage(confirmMsg, { parse_mode: "HTML" });63 64} catch (err) {65 Bot.sendMessage("⚠️ Error: " + err.message);66}