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/_setprice.js
javascript · 41 lines
1/**#command2name: /setprice3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13 // 1. Admin ID validation check14 if (String(user.telegramid) !== "8875810358") {15 Bot.sendMessage("❌ You are not authorized to use this command.");16 return;17 }18 19 // 2. Check agar parameters empty hain20 if (!params || params.trim() === "") {21 Bot.sendMessage("⚠️ *Format galat hai!*\nAise use karein: `setprice 450` ya `/setprice 450`", { parse_mode: "Markdown" });22 return;23 }24 25 // 3. String se number nikalna aur check karna26 let newPrice = parseInt(params.trim(), 10);27 28 if (isNaN(newPrice) || newPrice <= 0) {29 Bot.sendMessage("⚠️ *Valid price enter karein!* Number hona chahiye.", { parse_mode: "Markdown" });30 return;31 }32 33 // 4. Global property me save karna34 Bot.setProperty("reseller_price", newPrice, "integer");35 36 // Success feedback message37 Bot.sendMessage("<tg-emoji emoji-id='6102856637343600044'>👑</tg-emoji> <b>[Admin Panel]</b>\n\n✅ Reseller Price successfully updated to: <b>₹" + newPrice + "</b>", { parse_mode: "HTML" });38 39} catch (err) {40 Bot.sendMessage("⚠️ Error: " + err.message);41}