kkapil9112/Hguuuuuv45botPublic · Bot Template
AITelegram commerce bot for an admin-managed digital store: admins create categories, products, time-based plans, stock entries and license keys, and can grant reseller roles or adjust user balances. End users can view their balance, start a deposit flow with an inline amount keypad, apply coupon codes, and navigate back to the store menu. It uses Bot properties for product/stock/coupon data and Libs.ResourcesLib for per-user balances.
Commercecommerceshopreselleradmin-panelbalanceproduct-management
102 commands0 envUpdated 29d agoCreated Aug 7, 2026
commands/_transfer_ownership.js
javascript · 65 lines
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") || "8812621370";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}