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.

Commercefreefiregame-hacksupi-paymentsqr-codesreseller-systemdynamic-pricing
ProfileTelegram
102 commands0 envUpdated 16d agoCreated Aug 22, 2026
Back to folder

commands/_manage_coadmin.js

javascript ยท 89 lines

Raw
1/**#command2name: /manage_coadmin3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// ๐Ÿ‘‘ OWNER-ONLY โ€” Manage Co-Admins14// Usage: /manage_coadmin add USERID | /manage_coadmin remove USERID | /manage_coadmin list15// Co-Admins get full /admin panel access (product/plan/key/price/coupon/broadcast controls)16// but CANNOT manage other co-admins or transfer ownership โ€” that stays Owner-only.17// =========================================================18 19try {20  var ownerId = Bot.getProperty("owner_id") || "8660373585";21  var currentChatId = String(chat.chatid);22 23  if (currentChatId !== ownerId) {24    Bot.sendMessage("โŒ Sirf Owner hi co-admins manage kar sakta hai!");25    return;26  }27 28  if (!params || params.trim() === "") {29    var coAdminList = Bot.getProperty("co_admin_list") || [];30    Bot.sendMessage(31      "โš ๏ธ <b>Format:</b>\n" +32      "<code>/manage_coadmin add USERID</code>\n" +33      "<code>/manage_coadmin remove USERID</code>\n" +34      "<code>/manage_coadmin list</code>\n\n" +35      "<b>Current Co-Admins:</b> " + (coAdminList.length ? coAdminList.join(", ") : "None"),36      { parse_mode: "HTML" }37    );38    return;39  }40 41  var parts = params.trim().split(" ");42  var action = parts[0].toLowerCase();43  var targetId = parts[1] ? parts[1].trim() : null;44 45  var coAdminList = Bot.getProperty("co_admin_list") || [];46 47  if (action === "list") {48    Bot.sendMessage(49      "<blockquote>๐Ÿ‘‘ <b>CO-ADMIN LIST</b></blockquote>\n\n" + (coAdminList.length ? coAdminList.map(function (id) { return "โ€ข <code>" + id + "</code>"; }).join("\n") : "<i>Koi co-admin nahi hai.</i>"),50      { parse_mode: "HTML" }51    );52    return;53  }54 55  if (!targetId || isNaN(Number(targetId))) {56    Bot.sendMessage("โŒ Valid User ID chahiye! Example: <code>/manage_coadmin add 123456789</code>", { parse_mode: "HTML" });57    return;58  }59 60  if (action === "add") {61    if (targetId === ownerId) {62      Bot.sendMessage("โŒ Owner khud apne aap ko co-admin nahi bana sakta!");63      return;64    }65    Bot.setProperty("co_admin_" + targetId, true, "boolean");66    if (coAdminList.indexOf(targetId) === -1) {67      coAdminList.push(targetId);68      Bot.setProperty("co_admin_list", coAdminList, "json");69    }70    Bot.sendMessage("โœ… <b>Co-Admin Added!</b> User <code>" + targetId + "</code> ab poora admin panel access kar sakta hai.", { parse_mode: "HTML" });71    try {72      Api.sendMessage({73        chat_id: targetId,74        text: "<blockquote>๐Ÿ‘‘ <b>YOU ARE NOW A CO-ADMIN!</b></blockquote>\n\n<i>Aapko is store ke admin panel ka full access de diya gaya hai. /admin command use karke access karein.</i>",75        parse_mode: "HTML"76      });77    } catch (e) {}78  } else if (action === "remove") {79    Bot.setProperty("co_admin_" + targetId, null, "boolean");80    var idx = coAdminList.indexOf(targetId);81    if (idx > -1) { coAdminList.splice(idx, 1); Bot.setProperty("co_admin_list", coAdminList, "json"); }82    Bot.sendMessage("โœ… <b>Co-Admin Removed!</b> User <code>" + targetId + "</code> ka admin access hata diya gaya.", { parse_mode: "HTML" });83  } else {84    Bot.sendMessage("โŒ Action 'add', 'remove', ya 'list' hona chahiye.");85  }86 87} catch (err) {88  Bot.sendMessage("โš ๏ธ Error: " + err.message);89}