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_reseller_price.js
javascript · 44 lines
1/**#command2name: /set_reseller_price3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 👑 ADMIN/CO-ADMIN — Set Reseller Upgrade Price14// Usage: /set_reseller_price 50015// =========================================================16 17try {18 var ownerId = Bot.getProperty("owner_id") || "8875810358";19 var currentChatId = String(chat.chatid);20 var isCoAdmin = Bot.getProperty("co_admin_" + currentChatId);21 22 if (currentChatId !== ownerId && !isCoAdmin) {23 Bot.sendMessage("❌ Restricted command!");24 return;25 }26 27 if (!params || params.trim() === "") {28 var current = Bot.getProperty("reseller_upgrade_price") || "Not set";29 Bot.sendMessage("⚠️ <b>Format:</b> <code>/set_reseller_price 500</code>\n\n<b>Current price:</b> ₹" + current, { parse_mode: "HTML" });30 return;31 }32 33 var price = parseFloat(params.trim());34 if (isNaN(price) || price <= 0) {35 Bot.sendMessage("❌ Valid price chahiye (number)!");36 return;37 }38 39 Bot.setProperty("reseller_upgrade_price", price, "number");40 Bot.sendMessage("✅ <b>Reseller Upgrade Price set:</b> ₹" + price.toFixed(2), { parse_mode: "HTML" });41 42} catch (err) {43 Bot.sendMessage("⚠️ Error: " + err.message);44}