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

javascript Β· 78 lines

Raw
1/**#command2name: /addbal_upi3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// πŸ’³ "UPI Pay" chosen on Add Balance screen β€” same purana Gram UPI Gateway QR14// flow jo pehle /press.js ke confirm button me seedha chalta tha.15// Amount hamesha β‚Ή (India price) me dikhta hai.16// =========================================================17 18try {19  let userId = user.telegramid;20  let callbackId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;21 22  let finalAmount = Number(parseFloat(params ? String(params).trim() : "0"));23  if (!isFinite(finalAmount) || finalAmount <= 0) {24    Bot.sendMessage("❌ Invalid amount!");25    return;26  }27 28  let e_gear = "<tg-emoji emoji-id='5348292765325212780'>βš™</tg-emoji>";29  var apiKey = Bot.getProperty("gramupi_api_key") || "";30  if (!apiKey) {31    Bot.sendMessage("❌ Gram UPI Gateway API Key configured nahi hai. Admin Panel β†’ Set Payment ( UPI + Gram UPI Gateway ) se set karein.", {parse_mode:"HTML"});32    return;33  }34 35  User.setProperty("deposit_amount", String(finalAmount), "string");36  User.setProperty("pending_pay_amount_" + userId, String(finalAmount), "string");37  User.setProperty("buy_expected_amount", Number(finalAmount), "number");38 39  HTTP.get({40      url: "https://gateway.anujbots.in/autoqr.php?api_key=" + encodeURIComponent(String(apiKey)) + "&amount=" + encodeURIComponent(String(Number(finalAmount.toFixed(2)))),41      success: "/onQR",42      error: "/onApiError"43  });44 45  let generatingText =46    "<blockquote>" + e_gear + " <b>Generating QR Code for β‚Ή" + finalAmount + "...</b>\n" +47    "<i>Please wait a moment</i></blockquote>";48 49  if (request && request.message) {50    Api.editMessageText({51      chat_id: chat.chatid,52      message_id: request.message.message_id,53      text: generatingText,54      parse_mode: "HTML"55    });56 57    try {58      Bot.setProperty("gen_msg_id_" + userId, request.message.message_id, "string");59      User.setProperty("gen_msg_id_" + userId, request.message.message_id, "string");60    } catch (e) {}61  } else {62    let genMsg = Api.sendMessage({ chat_id: chat.chatid, text: generatingText, parse_mode: "HTML" });63    try {64      let gmid = (genMsg && genMsg.result && genMsg.result.message_id) ? genMsg.result.message_id : (genMsg && genMsg.message_id ? genMsg.message_id : null);65      if (gmid) {66        Bot.setProperty("gen_msg_id_" + userId, gmid, "string");67        User.setProperty("gen_msg_id_" + userId, gmid, "string");68      }69    } catch (e) {}70  }71 72  if (callbackId) {73    Api.answerCallbackQuery({ callback_query_id: String(callbackId) });74  }75 76} catch (err) {77  Bot.sendMessage("⚠️ System Error: " + err.message);78}