ashoksarande3/ASHOK_HACK_STORE_BOTPublic · Bot Template
AIThis bot operates as a commercial storefront for selling Free Fire game hacks and cheats via UPI QR code payments. It features a dynamic pricing system with separate normal and reseller prices, product plans with flexible durations (days, hours, minutes), and a reseller program requiring a one-time upgrade fee. The bot handles payment verification through QR code generation and expiry tracking, user verification via Telegram contact sharing, and admin tools for stock management, plan creation, and ownership transfer. It includes a balance system, maintenance mode, and Telegram Stars payment fallback. The codebase uses TeleBotHost's TBL JavaScript APIs (Bot, Api, HTTP, db properties, Libs) for all logic.
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") || "8660373585";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}