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/_transfer_ownership.js

javascript · 65 lines

Raw
1/**#command2name: /transfer_ownership3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 👑 OWNER-ONLY — Transfer Ownership14// Usage: /transfer_ownership USERID15// ⚠️ IMPORTANT LIMITATION: this updates the dynamic "owner_id" property that16// NEW commands (admin panel, coupon, co-admin, maintenance) check. Older17// admin-only commands in this bot (addproduct, addkey, addbal, etc.) still18// have the original owner ID hardcoded as literal text in ~30 files — those19// would need a separate one-time refactor to fully recognize a new owner too.20// =========================================================21 22try {23  var ownerId = Bot.getProperty("owner_id") || "8875810358";24  var currentChatId = String(chat.chatid);25 26  if (currentChatId !== ownerId) {27    Bot.sendMessage("❌ Sirf current Owner hi ownership transfer kar sakta hai!");28    return;29  }30 31  if (!params || params.trim() === "") {32    Bot.sendMessage("⚠️ <b>Format:</b> <code>/transfer_ownership USERID</code>", { parse_mode: "HTML" });33    return;34  }35 36  var newOwnerId = params.trim();37  if (isNaN(Number(newOwnerId))) {38    Bot.sendMessage("❌ Valid numeric User ID chahiye!");39    return;40  }41  if (newOwnerId === ownerId) {42    Bot.sendMessage("❌ Ye to already aap hi hain!");43    return;44  }45 46  User.setProperty("pending_ownership_transfer_to", newOwnerId, "string");47 48  Api.sendMessage({49    chat_id: chat.chatid,50    text: "<blockquote>⚠️ <b>CONFIRM OWNERSHIP TRANSFER</b></blockquote>\n\n" +51          "Aap ownership <code>" + newOwnerId + "</code> ko transfer karne wale hain.\n" +52          "<b>Ye action turant apply hoga aur aap Owner nahi rahenge!</b>\n\n" +53          "<i>Kya aap sure hain?</i>",54    parse_mode: "HTML",55    reply_markup: JSON.stringify({56      inline_keyboard: [[57        { text: "Confirm Transfer", callback_data: "/confirm_ownership_transfer", style: "danger", icon_custom_emoji_id: "6215386799133433653" },58        { text: "Cancel", callback_data: "/cancel_ownership_transfer", style: "primary" }59      ]]60    })61  });62 63} catch (err) {64  Bot.sendMessage("⚠️ Error: " + err.message);65}