mansuriamaan803/SANJEEVFFSTORE_botPublic · Bot Template
AIThis bot is a commerce platform for selling digital products, primarily focused on FreeFire accounts and related services. It provides admin tools for managing products, categories, stock, reseller roles, and a balance system for user payments. Users can browse products, apply coupons, and check their balance through an interactive interface with premium emojis and inline keyboards.
Commercecommercestoreproductsresellerbalancecoupon
102 commands0 envUpdated 12d agoCreated Aug 26, 2026
commands/_view_keys_list.js
javascript · 85 lines
1/**#command2name: /view_keys_list3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13 var adminId = "8963001413";14 if (String(chat.chatid) !== adminId) return;15 16 var callbackId = request ? request.id : null;17 var dataStr = params ? params.trim() : "";18 19 if (!dataStr) {20 var cbData = request && request.callback_query ? request.callback_query.data : "";21 dataStr = cbData.replace("/view_keys_list ", "");22 }23 24 if (!dataStr) {25 if (callbackId) Api.answerCallbackQuery({ callback_query_id: callbackId, text: "❌ Empty execution data string!", show_alert: true });26 return;27 }28 29 var parts = dataStr.split("|");30 var prodName = parts[0].trim();31 var cleanPlanDays = parts[1].trim();32 33 // Fetch from key properties tables34 var stockKeyText = "stock_" + prodName + "_" + cleanPlanDays;35 var keyStock = Bot.getProperty(stockKeyText) || [];36 37 if (keyStock.length === 0) {38 if (callbackId) {39 Api.answerCallbackQuery({ callback_query_id: callbackId, text: "❌ Is plan me currently 0 keys hain!", show_alert: true });40 } else {41 Bot.sendMessage("❌ Stock empty for: " + prodName + " (" + cleanPlanDays + ")");42 }43 return;44 }45 46 var reportText = "<blockquote><b>🔑 LIVE ACTIVE KEYS LIST</b>\n\n" +47 "• <b>Product:</b> <code>" + prodName.toUpperCase() + "</code>\n" +48 "• <b>Plan:</b> <code>" + cleanPlanDays + "</code>\n" +49 "• <b>Total Available:</b> <code>" + keyStock.length + " Keys</code>\n" +50 "━━━━━━━━━━━━━━━━━━━━━━━━━━\n";51 52 for (var i = 0; i < keyStock.length; i++) {53 reportText += (i + 1) + ". <code>" + keyStock[i] + "</code>\n";54 }55 56 reportText += "</blockquote>";57 58 var inlineButtons = [59 [60 { text: "⬅️ Back to Stock List", callback_data: "/allkey" }61 ]62 ];63 64 if (request && request.message) {65 HTTP.post({66 url: "https://api.telegram.org/bot" + bot.token + "/editMessageText",67 body: {68 chat_id: String(chat.chatid),69 message_id: Number(request.message.message_id),70 text: reportText,71 parse_mode: "HTML",72 reply_markup: JSON.stringify({ inline_keyboard: inlineButtons })73 }74 });75 } else {76 Bot.sendMessage(reportText, { parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: inlineButtons }) });77 }78 79 if (callbackId) {80 Api.answerCallbackQuery({ callback_query_id: callbackId, text: "Keys fetched!" });81 }82 83} catch (err) {84 Bot.sendMessage("⚠️ Rendering Keys List Mismatch: " + err.message);85}