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

javascript Β· 88 lines

Raw
1/**#command2name: /removememberprice3answer: 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 52 53// Remove a member-specific price and restore the normal/reseller price.54// Usage: /removememberprice USER_ID | PRODUCT NAME | DURATION55 56try {57  var ownerId = Bot.getProperty("owner_id") || "7839151435";58  var currentChatId = String(chat.chatid);59  var isCoAdmin = Bot.getProperty("co_admin_" + currentChatId);60  if (currentChatId !== String(ownerId) && !isCoAdmin) return;61 62  var parts = (params ? String(params).trim() : "").split("|");63  if (parts.length !== 3) {64    Bot.sendMessage("⚠️ Format: <code>/removememberprice USER_ID | PRODUCT NAME | DURATION</code>", { parse_mode: "HTML" });65    return;66  }67 68  var targetId = parts[0].trim();69  var productName = parts[1].trim().toUpperCase().replace(/\s+/g, " ");70  var duration = parts[2].trim().toLowerCase();71  var m = duration.match(/^([0-9]+(?:\.[0-9]+)?)\s*(h|hr|hrs|hour|hours|d|day|days)$/);72 73  if (!/^\d+$/.test(targetId) || !m) {74    Bot.sendMessage("❌ User ID ya duration invalid hai. Example: <code>123456789 | PRIME HOOK | 7d</code>", { parse_mode: "HTML" });75    return;76  }77 78  var value = m[1];79  var unit = /^h/.test(m[2]) ? "hour" : "day";80  var suffix = unit === "day" ? value : value + "_hour";81  var keyProduct = productName.replace(/[^A-Z0-9_-]/g, "_");82  var key = "member_custom_price_" + targetId + "_" + keyProduct + "_" + suffix;83 84  Bot.setProperty(key, null, "number");85  Bot.sendMessage("βœ… Member custom price removed. Ab member ko <b>" + value + " " + (unit === "hour" ? "Hour" : "Day") + "</b> ke liye normal/reseller price milega.", { parse_mode: "HTML" });86} catch (err) {87  Bot.sendMessage("⚠️ Remove member price error: " + err.message);88}