indrajitghosh20006/Igstore_01botPublic Β· Bot Template

ProfileTelegram

AIThe bot provides an admin interface for a digital store, allowing the owner or co‑admins to add balances, products, plans, and categories. It supports payment workflows via UPI and Binance Pay, automatically generating QR codes and handling manual approval of deposits. The code patches inline keyboards to use premium emoji icons and includes helper functions for user and bot properties. Overall, it serves as a commerce management tool for a Telegram-based storefront.

Commercestoreadminbalanceproductplancategory
170 commands0 envUpdated 7h agoCreated Oct 30, 2026
Back to folder

commands/_panel_maintenance.js

javascript Β· 194 lines

Raw
1/**#command2name: /panel_maintenance3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: /panel_maintenance14answer:15keyboard:16parse_mode: html17aliases:18allow_only_group: false19need_reply: false20case_insensitive: false21is_web: 022#command**/23 24try {25 26  var adminId = String(Bot.getProperty("owner_id") || "8885285219");27  var currentChatId = String(chat.chatid);28  var isCoAdmin = Bot.getProperty("co_admin_" + currentChatId);29 30  if (currentChatId !== adminId && !isCoAdmin) {31    Bot.sendMessage("❌ Only Admin/Co-Admin can manage panel maintenance.");32    return;33  }34 35  var products = Bot.getProperty("stored_products") || [];36 37  if (!Array.isArray(products)) {38    products = [];39  }40 41  var buttons = [];42 43  for (var i = 0; i < products.length; i++) {44 45    var p = products[i];46 47    if (!p) continue;48 49    var name = String(50      p.name || ("Panel " + (i + 1))51    );52 53    var key =54      "panel_maintenance_" +55      String(p.id || p.name || i)56        .toUpperCase()57        .replace(/[^A-Z0-9_-]/g, "_");58 59    var isOn = Bot.getProperty(key) === true;60 61    buttons.push([{62      text: isOn63        ? "πŸ›  ON β€’ " + name64        : "🟒 OFF β€’ " + name,65 66      callback_data: "/maintenance_toggle " + i,67 68      style: isOn69        ? "danger"70        : "success",71 72      icon_custom_emoji_id: isOn73        ? "6100657257605763582"74        : "6093677128295914531"75    }]);76  }77 78  if (products.length === 0) {79 80    buttons.push([{81      text: "βž• No Products Found",82      callback_data: "/panel_maintenance",83      style: "primary"84    }]);85 86  }87 88  buttons.push([{89    text: "πŸ”„ Refresh",90    callback_data: "/panel_maintenance",91    style: "primary",92    icon_custom_emoji_id: "6093677128295914531"93  }]);94 95  buttons.push([{96    text: "⬅️ Admin Panel",97    callback_data: "/admin",98    style: "danger",99    icon_custom_emoji_id: "5893163582194978381"100  }]);101 102  var text =103    "<blockquote><tg-emoji emoji-id='6100657257605763582'>πŸ› </tg-emoji> <b>PANEL MAINTENANCE CONTROL</b></blockquote>\n\n" +104    "<i>Har panel ko alag se ON/OFF karein.</i>\n\n" +105    "🟒 <b>OFF</b> β€” Panel live\n" +106    "πŸ›  <b>ON</b> β€” Purchase/Payment blocked";107 108  if (109    request &&110    request.message &&111    request.message.message_id &&112    !request.message.photo113  ) {114 115    try {116 117      Api.editMessageText({118        chat_id: currentChatId,119        message_id: Number(request.message.message_id),120        text: text,121        parse_mode: "HTML",122        reply_markup: JSON.stringify({123          inline_keyboard: buttons124        })125      });126 127    } catch (e) {128 129      Api.sendMessage({130        chat_id: currentChatId,131        text: text,132        parse_mode: "HTML",133        reply_markup: JSON.stringify({134          inline_keyboard: buttons135        })136      });137 138    }139 140  } else {141 142    if (143      request &&144      request.message &&145      request.message.message_id &&146      request.message.photo147    ) {148 149      try {150 151        Api.deleteMessage({152          chat_id: currentChatId,153          message_id: Number(request.message.message_id)154        });155 156      } catch (e) {}157 158    }159 160    Api.sendMessage({161      chat_id: currentChatId,162      text: text,163      parse_mode: "HTML",164      reply_markup: JSON.stringify({165        inline_keyboard: buttons166      })167    });168  }169 170  var qid = request171    ? (request.id ||172       (request.callback_query && request.callback_query.id))173    : null;174 175  if (qid) {176 177    try {178 179      Api.answerCallbackQuery({180        callback_query_id: String(qid)181      });182 183    } catch (e) {}184 185  }186 187} catch (err) {188 189  Bot.sendMessage(190    "⚠️ Panel Maintenance Error:\n" +191    (err && err.message ? err.message : String(err))192  );193 194}