pnxh2371/Ankit_mods_store_botPublic ยท Bot Template

ProfileTelegram

AI๐€ษดแด‹ษชแด› ๐Œแดแด…๊œฑ ๐’แด›แดส€แด‡ ๐Ÿ› 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
133 commands0 envUpdated 7h agoCreated Sep 10, 2026
Back to folder

commands/_buy_hack_cat.js

javascript ยท 122 lines

Raw
1/**#command2name: /buy_hack_cat3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// ๐Ÿ›’ SHOP MENU โ€” Product listing filtered by category (Step 1.5)14// Called after user selects "ANDROID ROOT" or "ANDROID NON ROOT" from15// /buy_hack. Shows only products matching that category. Products added16// with category "both" (or no category set at all โ€” legacy products)17// show up under BOTH root and nonroot listings.18// =========================================================19 20try {21  var rawData = Bot.getProperty("stored_products");22  var productList = [];23 24  if (Array.isArray(rawData)) {25    productList = rawData;26  } else if (typeof rawData === "string") {27    try {28      productList = JSON.parse(rawData);29      if (!Array.isArray(productList)) { productList = []; }30    } catch (e) {31      productList = [];32    }33  }34 35  var chatId = chat.chatid;36  var firstName = user && user.first_name ? user.first_name : "User";37 38  // Category param โ€” "root" or "nonroot"39  var category = params ? params.trim().toLowerCase() : "";40  if (category === "") {41    var cbData = request && request.callback_query ? request.callback_query.data : "";42    category = cbData.replace("/buy_hack_cat ", "").replace("buy_hack_cat ", "").trim().toLowerCase();43  }44  if (category !== "root" && category !== "nonroot" && category !== "iphone") { category = "nonroot"; }45 46  var categoryLabel = (category === "root") ? "ANDROID ROOT" : (category === "iphone") ? "iPHONE" : "ANDROID NON ROOT";47 48  var productButtons = [];49 50  for (var i = 0; i < productList.length; i++) {51    var item = productList[i];52    if (!item) { continue; }53 54    // Legacy products (no category field) ya "both" wale โ€” dono categories me dikhte hain.55    var itemCategory = item.category ? String(item.category).toLowerCase() : "both";56    if (itemCategory !== "both" && itemCategory !== category) { continue; }57 58    var itemName = item.name ? String(item.name) : "Product " + (i + 1);59    var itemEmoji = item.emoji ? String(item.emoji) : "5226656353744862682";60 61    productButtons.push([62      {63        text: itemName,64        callback_data: "/viewprod " + i,65        style: "primary",66        icon_custom_emoji_id: itemEmoji67      }68    ]);69  }70 71  var storeText;72 73  if (productButtons.length === 0) {74    storeText =75      "<blockquote><b>" + categoryLabel + "</b></blockquote>\n" +76      "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\n" +77      "<tg-emoji emoji-id='6093854128193152827'>โš ๏ธ</tg-emoji> <i>Is category me abhi koi product available nahi hai. Jald hi add kiya jayega!</i>\n" +78      "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”";79  } else {80    storeText =81      "<blockquote><b>" + categoryLabel + " โ€” SELECT A PRODUCT</b></blockquote>\n" +82      "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\n" +83      "<tg-emoji emoji-id='6091571559233755994'>๐Ÿ‘‹</tg-emoji> <b>Yoo " + firstName + "!</b>\n" +84      "<i>Choose any product below to view its price and available duration plans.</i>\n" +85      "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”";86  }87 88  productButtons.push([89    {90      text: "Back",91      callback_data: "/buy_hack",92      style: "default",93      icon_custom_emoji_id: "5877536313623711363"94    }95  ]);96 97  var replyMarkupStr = JSON.stringify({ inline_keyboard: productButtons });98 99  if (request && request.message && request.message.message_id) {100    if (request.message.photo) {101      try { Api.deleteMessage({ chat_id: chatId, message_id: request.message.message_id }); } catch (e) {}102      Api.sendMessage({ chat_id: chatId, text: storeText, parse_mode: "HTML", reply_markup: replyMarkupStr });103    } else {104      Api.editMessageText({105        chat_id: chatId,106        message_id: request.message.message_id,107        text: storeText,108        parse_mode: "HTML",109        reply_markup: replyMarkupStr110      });111    }112  } else {113    Api.sendMessage({ chat_id: chatId, text: storeText, parse_mode: "HTML", reply_markup: replyMarkupStr });114  }115 116  if (request && request.id) {117    try { Api.answerCallbackQuery({ callback_query_id: request.id }); } catch (e) {}118  }119 120} catch (err) {121  Bot.sendMessage("โš ๏ธ Shop Menu Error: " + err.message, { parse_mode: "HTML" });122}