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

Commercecommercedigital-goodsstars-paymentreseller-systemadmin-panelstock-management
ProfileTelegram
119 commands0 envUpdated 15d agoCreated Aug 23, 2026
Back to folder

commands/_toggle_reseller_system.js

javascript · 46 lines

Raw
1/**#command2name: /toggle_reseller_system3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 👑 ADMIN/CO-ADMIN — Enable/Disable Reseller Upgrade System14// =========================================================15 16try {17  var ownerId = Bot.getProperty("owner_id") || "8875810358";18  var currentChatId = String(chat.chatid);19  var isCoAdmin = Bot.getProperty("co_admin_" + currentChatId);20 21  if (currentChatId !== ownerId && !isCoAdmin) {22    Bot.sendMessage("❌ Restricted command!");23    return;24  }25 26  var current = Bot.getProperty("reseller_system_enabled") || false;27  var newState = !current;28  Bot.setProperty("reseller_system_enabled", newState, "boolean");29 30  var price = Bot.getProperty("reseller_upgrade_price");31 32  if (newState) {33    Bot.sendMessage(34      "<blockquote>👑 <b>RESELLER SYSTEM ENABLED</b></blockquote>\n\n" +35      (price36        ? "<i>Users ko ab menu me 'Reseller Upgrade' button dikhega — Price: ₹" + price + "</i>"37        : "<tg-emoji emoji-id='6100657257605763582'>⚠️</tg-emoji> <i>Price abhi set nahi hai! Pehle <code>/set_reseller_price AMOUNT</code> use karein.</i>"),38      { parse_mode: "HTML" }39    );40  } else {41    Bot.sendMessage("<blockquote>❌ <b>RESELLER SYSTEM DISABLED</b></blockquote>\n\n<i>Reseller Upgrade button ab kisi ko nahi dikhega.</i>", { parse_mode: "HTML" });42  }43 44} catch (err) {45  Bot.sendMessage("⚠️ Error: " + err.message);46}