indrajitghosh20006/Testseller_01botPublic · Bot Template

ProfileTelegram

AIThis bot provides an admin‑controlled system for managing user balances, products, and reseller roles. It includes commands to add balances (via manual input, Binance Pay, or UPI), approve and credit payments, and set up product listings with categories and pricing. Admins can also add resellers, view reseller info, and manage stock entries. The bot uses built‑in TeleBotHost APIs such as Bot, Api, HTTP, and Libs for database operations and message handling.

Commerceadminbalanceproductresellerpaymentsbinance
138 commands0 envUpdated 17h agoCreated Sep 27, 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") || "7839151435";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}