amanjha18v/AMAN_SHOPS_BOTPublic · Bot Template

AIAMAN SHOP STORE appears to be a Telegram automation bot. Commands include /*, /addbal, /addbal_all, /addbal_binance, /addbal_binance_approve, /addbal_binance_paid, /addbal_upi, /addcat_id. Observed in code: messaging, http, libs, keyboards, payments.

Utilityutility
ProfileTelegram
132 commands0 envUpdated 6h agoCreated Sep 4, 2026
Back to folder

commands/_admin.js

javascript · 184 lines

Raw
1/**#command2name: /admin3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  // ✅ FIXED (v3): dynamic owner_id (same fix as /addbal) so this stays correct14  // even after ownership transfer, instead of a frozen hardcoded ID.15  var adminId = Bot.getProperty("owner_id") || "5191323229";16 17  var currentChatId = (typeof chat !== 'undefined' && chat && chat.chatid) ? String(chat.chatid) : null;18  var isCoAdmin = currentChatId && Bot.getProperty("co_admin_" + currentChatId);19  if (currentChatId !== adminId && !isCoAdmin) {20    Bot.sendMessage("❌ Restricted command! Only accessible by Owner.");21    return;22  }23 24  // Live Database Metrics Extraction25  var userList = Bot.getProperty("all_users_list") || [];26  var totalUsers = userList.length;27  var currentResellerPrice = Bot.getProperty("reseller_upgrade_price") || "Not Set";28 29  // 📝 PREMIUM ADMINISTRATIVE MASTER INTERFACE30  var adminPanelText = 31    "<blockquote><b><tg-emoji emoji-id='6064138396228392033'>👑</tg-emoji> MASTER ADMINISTRATIVE PANEL</b>\n\n" +32    "<i>Welcome back Boss! Securely manage your store microservices, logs, databases, plans, and inventory control nodes below.</i></blockquote>\n" +33    "━━━━━━━━━━━━━━━━━━━━━━━━━━\n" +34    "<blockquote><b><tg-emoji emoji-id='6039605143601680423'>📊</tg-emoji> BOT INFRASTRUCTURE SUMMARY</b>\n\n" +35    "• <b>Total Registered Users:</b> <code>" + totalUsers + " Users</code>\n" +36    "• <b>Reseller Upgrade Price:</b> <code>₹" + currentResellerPrice + "</code></blockquote>\n" +37    "━━━━━━━━━━━━━━━━━━━━━━━━━━\n" +38    "<tg-emoji emoji-id='5346024644635804737'>🔰</tg-emoji> <b>Select an operational control terminal module:</b>";39 40  // 🎨 ADVANCED SYSTEM CUSTOM-EMOJI INFRASTRUCTURE41  var adminKeyboard = [42    // Row 1: Product Structure (Success vs Danger Vector)43    [44      { text: "Add Product", callback_data: "/addproduct", style: "success", icon_custom_emoji_id: "5348392971207194994" },45      { text: "Remove Product", callback_data: "/removeproduct", style: "danger", icon_custom_emoji_id: "6143299028655280273" }46    ],47    // Row 2: Plan / Validity Variants48    [49      { text: "Add Plan", callback_data: "/addplan", style: "primary", icon_custom_emoji_id: "6194922667242429131" },50      { text: "Remove Plan", callback_data: "/removeplan", style: "danger", icon_custom_emoji_id: "6143299028655280273" }51    ],52    // Row 3: License Key Inventory System53    [54      { text: "Add Key", callback_data: "/addkey", style: "success", icon_custom_emoji_id: "6195196054795721892" },55      { text: "Remove Key", callback_data: "/removekey", style: "danger", icon_custom_emoji_id: "6143299028655280273" }56    ],57    // Row 4: FF ID Category Configurations58    [59      { text: "Add Cat for ID", callback_data: "/addcat_id", style: "success", icon_custom_emoji_id: "5334890573281114250" },60      { text: "Rem Cat for ID", callback_data: "/remcat_id", style: "danger", icon_custom_emoji_id: "6143299028655280273" }61    ],62    // Row 5: FF ID Stock Controls63    [64      { text: "Add Stock ID", callback_data: "/addstock_id", style: "success", icon_custom_emoji_id: "6195196054795721892" },65      { text: "Remove Stock ID", callback_data: "/remstock_id", style: "danger", icon_custom_emoji_id: "6143299028655280273" }66    ],67    // Row 5b: Stock Monitoring & Clear Control (UPDATED)68    [69      { text: "Check ID Stock", callback_data: "/allstocks", style: "primary", icon_custom_emoji_id: "6039605143601680423" },70      { text: "Clear All ID Stock", callback_data: "/clearstock", style: "danger", icon_custom_emoji_id: "6143299028655280273" }71    ],72    // Row 6: ID Pricing Controls73    [74      { text: "Set Normal Price ID", callback_data: "/normalprice_id", style: "primary", icon_custom_emoji_id: "5778145208411624388" },75      { text: "Set Reseller Price ID", callback_data: "/resellerprice_id", style: "success", icon_custom_emoji_id: "6267068789146260253" }76    ],77    // Row 7: Pricing Matrix Configurations (Global Keys)78    [79      { text: "Set All Products Normal Price", callback_data: "/normalprice", style: "primary", icon_custom_emoji_id: "5778145208411624388" },80      { text: "Set All Products Reseller Price", callback_data: "/setresellerprice", style: "success", icon_custom_emoji_id: "6267068789146260253" }81    ],82    // Row 8: Financial Wallet Controls83    [84      { text: "Add Bal", callback_data: "/addbal", style: "success", icon_custom_emoji_id: "5778145208411624388" },85      { text: "Remove Bal", callback_data: "/rembal", style: "danger", icon_custom_emoji_id: "6143299028655280273" },86      { text: "Check Bal", callback_data: "/checkbal", style: "primary", icon_custom_emoji_id: "6039605143601680423" }87    ],88    // Row 8b: Bulk Wallet Control89    [90      { text: "Add Bal To All Users", callback_data: "/addbal_all", style: "success", icon_custom_emoji_id: "5778145208411624388" }91    ],92    // Row 9: Reseller Authorization Cluster93    [94      { text: "Add Reseller", callback_data: "/addreseller", style: "success", icon_custom_emoji_id: "6195245116207143870" },95      { text: "Remove Reseller", callback_data: "/removereseller", style: "danger", icon_custom_emoji_id: "6143299028655280273" },96      { text: "View Role", callback_data: "/role", style: "primary", icon_custom_emoji_id: "6064138396228392033" }97    ],98    // Row 10: Global Parameters & Auditing Tools99    [100      { text: " Set Reseller Upgrade Fee", callback_data: "/setprice", style: "primary", icon_custom_emoji_id: "5463172695132745432" },101      { text: "All Keys", callback_data: "/allkey", style: "success", icon_custom_emoji_id: "6010210211334200822" },102      { text: "Total Users", callback_data: "/check_users", style: "primary", icon_custom_emoji_id: "6039605143601680423" }103    ],104    // Row 11: Core System Communications Hub105    [106      { text: "Broadcast System Terminal", callback_data: "/broadcast", style: "primary", icon_custom_emoji_id: "6041705726206808304" }107    ],108    // Row 12: 🎟 Coupon System (NEW)109    [110      { text: "Generate Coupon", callback_data: "/gencoupon", style: "success", icon_custom_emoji_id: "6093677128295914531" },111      { text: "View Coupons", callback_data: "/coupons", style: "primary", icon_custom_emoji_id: "6102818532393750087" }112    ],113    // Row 13: 👑 Ownership / Co-Admin Controls (NEW — Owner only, not Co-Admins)114    [115      { text: "Manage Co-Admins", callback_data: "/manage_coadmin", style: "primary", icon_custom_emoji_id: "6102856637343600044" },116      { text: "Transfer Ownership", callback_data: "/transfer_ownership", style: "danger", icon_custom_emoji_id: "6215386799133433653" }117    ],118    // Row 14: 🛠 Maintenance Mode119    [120      { text: "Maintenance Mode", callback_data: "/toggle_maintenance", style: "danger", icon_custom_emoji_id: "6100657257605763582" }121    ],122    // Row 15: 💎 Reseller System (NEW)123    [124      { text: "Toggle Reseller System", callback_data: "/toggle_reseller_system", style: "success", icon_custom_emoji_id: "6102856637343600044" },125      { text: "Set Reseller Price", callback_data: "/set_reseller_price", style: "primary", icon_custom_emoji_id: "6312263493051489212" }126    ],127    // Row 16: 👑 Direct Reseller (NEW) — admin types a User ID, no payment needed128    [129      { text: "Direct Reseller (by User ID)", callback_data: "/addreseller_info", style: "success", icon_custom_emoji_id: "6215386799133433653" }130    ],131    // Row 17: 💸 Auto-Discount System (NEW)132    [133      { text: "Set Product/Plan Discount", callback_data: "/set_discount", style: "primary", icon_custom_emoji_id: "6093677128295914531" }134    ],135    // Row 18: 🔗 Download Files Link (NEW)136    [137      { text: "Set Download Link", callback_data: "/set_download_link_btn", style: "primary", icon_custom_emoji_id: "6091571559233755994" }138    ],139    // Row 19: 💳 Payment API / UPI Control (NEW)140    [141      { text: "Set Payment (UPI + Fam Pay API)", callback_data: "/set_payment_upi_btn", style: "primary", icon_custom_emoji_id: "6312263493051489212" }142    ],143    // Row 19b: 🟡 Binance Pay Control (NEW)144    [145      { text: "Set Payment (Binance Pay)", callback_data: "/set_payment_binance_btn", style: "primary", icon_custom_emoji_id: "6312263493051489212" }146    ],147    // Row 20: 🎁 Daily Gift Price Control (NEW)148    [149      { text: "Set Daily Gift Price", callback_data: "/set_dailygift_price_btn", style: "success", icon_custom_emoji_id: "6194922667242429131" }150    ],151    // Row 21: 🎁 Refer & Earn Amount Control (NEW)152    [153      { text: "Set Refer & Earn Amount", callback_data: "/set_refer_earn_btn", style: "success", icon_custom_emoji_id: "5823654080584618403" }154    ],155    // Row 22: 📹 How To Use Link Control (NEW)156    [157      { text: "Set How-To-Use Link", callback_data: "/set_how_link_btn", style: "primary", icon_custom_emoji_id: "5258077307985207053" }158    ],159    // Row 23: ✅ Payment Proof Link Control (NEW)160    [161      { text: "Set Payment Proof Link", callback_data: "/set_proof_link_btn", style: "primary", icon_custom_emoji_id: "5330237710655306682" }162    ],163    // Row 24: 📞 Support Admin Username Link Control (NEW)164    [165      { text: "Set Support Link", callback_data: "/set_support_link_btn", style: "danger", icon_custom_emoji_id: "6267129592998270736" }166    ]167  ];168 169  // 🤖 DISPATCH PIPELINE EXECUTION170  // ✅ FIXED: pehle ye hamesha hardcoded adminId ko panel bhejta tha — agar171  // koi co-admin /admin kholta, to panel unko na milkar owner ke chat me172  // chala jaata tha. Ab panel usi chat me jaata hai jisne /admin request kiya.173  Api.sendMessage({174    chat_id: currentChatId,175    text: adminPanelText,176    parse_mode: "HTML",177    reply_markup: JSON.stringify({178      inline_keyboard: adminKeyboard179    })180  });181 182} catch (err) {183  Bot.sendMessage("Admin Panel Premium Cluster Error: " + err.message);184}