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
132 commands0 envUpdated 7h agoCreated Sep 4, 2026
commands/_select_id_product.js
javascript · 179 lines
1/**#command2name: /select_id_product3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: /select_id_product14answer: 15keyboard: 16parse_mode: markdown17aliases: 18allow_only_group: false19need_reply: false20case_insensitive: false21is_web: 022#command**/23 24try {25 var rawParams = "";26 if (typeof params !== "undefined" && params) {27 rawParams = String(params).trim();28 }29 30 if (!rawParams && typeof request !== "undefined" && request) {31 var callbackQuery = request.callback_query || request;32 if (callbackQuery && callbackQuery.data) {33 var dataStr = String(callbackQuery.data).trim();34 var parts = dataStr.split(" ");35 rawParams = parts.length > 1 ? parts.slice(1).join(" ").trim() : dataStr;36 }37 }38 39 var targetChatId = (chat && chat.chatid) ? chat.chatid : ((chat && chat.id) ? chat.id : (user ? user.telegramid : null));40 if (!targetChatId) return;41 42 if (!rawParams || rawParams.indexOf("/") === 0) { 43 Api.sendMessage({44 chat_id: targetChatId,45 text: "⚠️ <b>Invalid Selection.</b>\n\nKripya main menu se phir se product select karein.",46 parse_mode: "HTML"47 });48 return;49 }50 51 var categories = Bot.getProperty("ff_categories") || {};52 53 if (!categories[rawParams]) {54 Api.sendMessage({55 chat_id: targetChatId,56 text: "❌ <b>Product nahi mila!</b>\nSelected Slug: <code>" + rawParams + "</code>",57 parse_mode: "HTML"58 });59 return;60 }61 62 var item = categories[rawParams];63 64 // 🛠️ MAINTENANCE CHECK65 var isMaintBySlug = Bot.getProperty("MAINTENANCE_" + rawParams, false);66 var isMaintByName = (item && item.name) ? Bot.getProperty("MAINTENANCE_" + item.name, false) : false;67 68 if (isMaintBySlug || isMaintByName) {69 var queryId = null;70 if (typeof request !== "undefined" && request) {71 queryId = request.id || (request.callback_query ? request.callback_query.id : null);72 }73 74 if (queryId) {75 Api.answerCallbackQuery({76 callback_query_id: queryId,77 text: "🛠️ MAINTENANCE ALERT!\n\nYeh product abhi maintenance me hai. Kripya kuch samay baad try karein.",78 show_alert: true79 });80 } else {81 Api.sendMessage({82 chat_id: targetChatId,83 text: "🛠️ <b>MAINTENANCE ALERT!</b>\n\nYeh product abhi maintenance me hai.",84 parse_mode: "HTML"85 });86 }87 return;88 }89 90 // Answer normal loading spinner91 if (typeof request !== "undefined" && request) {92 let qId = request.id || (request.callback_query ? request.callback_query.id : null);93 if (qId) {94 try { Api.answerCallbackQuery({ callback_query_id: qId }); } catch (qErr){}95 }96 }97 98 var stockList = Bot.getProperty("ff_stock_" + rawParams) || [];99 if (!Array.isArray(stockList)) stockList = [];100 101 var userId = (user && user.telegramid) ? user.telegramid : targetChatId;102 var isReseller = Bot.getProperty("is_reseller_" + userId);103 var hasResellerAccess = (isReseller === true || String(isReseller).toLowerCase() === "true");104 105 var price = hasResellerAccess106 ? (item.reseller_price !== undefined && item.reseller_price !== null ? item.reseller_price : (item.normal_price || 0))107 : (item.normal_price || 0);108 109 var text =110 "┏━━━━━━━━━━━━━━━━━━━━━━━━┓\n" +111 "┃ ❤️🔥 <b>ALL DETAILS</b> ❤️🔥 ┃\n" +112 "┗━━━━━━━━━━━━━━━━━━━━━━━━┛\n\n" +113 "━━━━━━━━━━━━━━━━━━━━━━━━━━\n" +114 "✨ <b>PRODUCT DETAILS:</b>\n\n" +115 "📣 <b>Product Name :</b> <code>" + item.name + "</code>\n\n" +116 "🪐 <b>Current Stocks :</b> <code>" + stockList.length + " accounts</code>\n\n" +117 "📈 <b>Price:</b> <code>₹" + price + "</code>\n\n" +118 "👑 <b>Account Type :</b> <b>" + (hasResellerAccess ? "Reseller" : "User") + "</b>\n" +119 "━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n" +120 "⚡ <i>Kripya confirmation ke liye niche diye gaye button par click karein.</i>";121 122 var purchaseButtonText = stockList.length > 0 ? "Confirm Purchase" : "❌ Out of Stock";123 var purchaseButtonStyle = stockList.length > 0 ? "success" : "danger"; 124 125 var buttons = {126 inline_keyboard: [127 [128 {129 text: purchaseButtonText,130 callback_data: stockList.length > 0 ? "/execute_id_buy " + rawParams : "/ff_id_menu"131 }132 ],133 [134 {135 text: "Back to Menu",136 callback_data: "/ff_id_menu"137 }138 ]139 ]140 };141 142 var targetMessageId = (typeof request !== "undefined" && request && request.message) ? request.message.message_id : null;143 144 if (targetMessageId) {145 try {146 Api.editMessageText({147 chat_id: targetChatId,148 message_id: targetMessageId,149 text: text,150 parse_mode: "HTML",151 reply_markup: JSON.stringify(buttons)152 });153 } catch (err) {154 Api.sendMessage({155 chat_id: targetChatId,156 text: text,157 parse_mode: "HTML",158 reply_markup: JSON.stringify(buttons)159 });160 }161 } else {162 Api.sendMessage({163 chat_id: targetChatId,164 text: text,165 parse_mode: "HTML",166 reply_markup: JSON.stringify(buttons)167 });168 }169 170} catch (e) {171 var errorChatId = (chat && chat.chatid) ? chat.chatid : ((user && user.telegramid) ? user.telegramid : "5191323229");172 try {173 Api.sendMessage({174 chat_id: errorChatId,175 text: "❌ <b>Checkout Error:</b>\n<code>" + e.message + "</code>",176 parse_mode: "HTML"177 });178 } catch(fatal){}179}