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/_resellerprice_id.js

javascript Β· 127 lines

Raw
1/**#command2name: /resellerprice_id3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// PREMIUM BUTTON ICONS13(function(){14  try {15    if (!JSON.__premiumPatched) {16      var __origStringify = JSON.stringify;17      JSON.stringify = function(value, replacer, space) {18        try {19          if (value && value.inline_keyboard && Array.isArray(value.inline_keyboard)) {20            var premiumIds = [21              "6143444134125379822",22              "6091379307907652768",23              "6147534454819661264",24              "6147817325660741985",25              "6235683689292897318",26              "6102856637343600044"27            ];28            var rows = value.inline_keyboard.map(function(row, ri) {29              if (!Array.isArray(row)) return row;30              return row.map(function(btn, bi) {31                if (!btn || typeof btn !== "object") return btn;32                var copy = {};33                for (var k in btn) copy[k] = btn[k];34                if (!copy.icon_custom_emoji_id) copy.icon_custom_emoji_id = premiumIds[(ri + bi) % premiumIds.length];35                return copy;36              });37            });38            var cloned = {};39            for (var key in value) cloned[key] = value[key];40            cloned.inline_keyboard = rows;41            return __origStringify.call(JSON, cloned, replacer, space);42          }43        } catch (e) {}44        return __origStringify.call(JSON, value, replacer, space);45      };46      JSON.__premiumPatched = true;47    }48  } catch (e) {}49})();50 51/**#command52name: /resellerprice_id53answer: 54keyboard: 55parse_mode: markdown56aliases: 57allow_only_group: false58need_reply: false59case_insensitive: false60is_web: 061#command**/62 63try {64  var adminId = "7839151435";65  if (!chat || String(chat.chatid) !== adminId) return;66 67  // πŸ”₯ CLEAR SPINNER IMMEDIATELY68  if (typeof request !== "undefined" && request) {69    let queryId = request.id || (request.callback_query && request.callback_query.id);70    if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: queryId }); } catch(qErr){} }71  }72 73  var rawInput = (typeof message !== "undefined" && message) ? message.trim() : "";74  if (!rawInput && typeof params !== "undefined" && params) { rawInput = String(params).trim(); }75 76  if (rawInput.indexOf("/resellerprice_id") === 0) {77    rawInput = rawInput.replace("/resellerprice_id", "").trim();78  }79 80  // πŸ›‘οΈ NO REPLY CRASH FIX: Display interactive instruction if text missing81  if (!rawInput) {82    Api.sendMessage({83      chat_id: adminId,84      text: "✍️ <b>Set Reseller Price Node Matrix:</b>\n\nKripya is text ko copy karein, edit karein aur reply mein bhejiye:\n\n<code>/resellerprice_id [Category Name] [Price]</code>\n\n<b>Example:</b>\n<code>/resellerprice_id Facebook Id 120</code>",85      parse_mode: "HTML"86    });87    return;88  }89 90  var parts = rawInput.split(" ");91  if (parts.length < 2) {92    Api.sendMessage({93      chat_id: adminId,94      text: "⚠️ <b>Format Galat Hai!</b>\nSahi tarika: <code>Category_Name Price</code>\nExample: <code>Facebook Id 120</code>",95      parse_mode: "HTML"96    });97    return;98  }99 100  var price = parts[parts.length - 1].trim();101  var catName = parts.slice(0, -1).join(" ").trim();102 103  if (isNaN(price)) {104    Api.sendMessage({ chat_id: adminId, text: "⚠️ <b>Price ek valid number hona chahiye!</b>" });105    return;106  }107 108  var catSlug = catName.toLowerCase().replace(/[^a-z0-9]/g, "");109  var categories = Bot.getProperty("ff_categories") || {};110 111  if (!categories[catSlug]) {112    Api.sendMessage({ chat_id: adminId, text: "❌ <b>Category [ " + catName + " ] system records mein nahi mili!</b>" });113    return;114  }115 116  categories[catSlug].reseller_price = parseFloat(price);117  Bot.setProperty("ff_categories", categories, "json");118 119  Api.sendMessage({120    chat_id: adminId,121    text: "βœ… <b>Reseller Price Updated Successfully!</b>\n\nβ€’ <b>Category:</b> <code>" + categories[catSlug].name + "</code>\nβ€’ <b>New Reseller Price:</b> <code>β‚Ή" + price + "</code>",122    parse_mode: "HTML"123  });124 125} catch(e) {126  Bot.sendMessage("Error in Set Reseller Price: " + e.message);127}