pnxh2371/Ankit_mods_store_botPublic · Bot Template

ProfileTelegram

AI𝐀ɴᴋɪᴛ 𝐌ᴏᴅꜱ 𝐒ᴛᴏʀᴇ 🛍 appears to be a Telegram automation bot. Commands include /*, /addbal, /addbal_all, /addbal_binance, /addbal_binance_approve, /addbal_binance_paid, /addbal_upi, /addcat_id. Observed in code: messaging, http, libs, keyboards, payments.

Utilityutility
133 commands0 envUpdated 7h agoCreated Sep 10, 2026
Back to folder

commands/_set_payment_upi.js

javascript · 67 lines

Raw
1/**#command2name: /set_payment_upi3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🔧 ADMIN — Configure the UPI ID used for all payment QR codes14// Usage: /set_payment_upi yourid@fam15// =========================================================16 17try {18  var adminId = Bot.getProperty("owner_id") || "6182067327";19  var requesterId = String(user.telegramid);20  var isCoAdmin0 = Bot.getProperty("co_admin_" + requesterId);21  if (requesterId !== String(adminId) && !isCoAdmin0) {22    Bot.sendMessage("❌ You are not the admin!");23    return;24  }25 26  if (!params || params.trim() === "") {27    var currentUpi0 = Bot.getProperty("payment_upi_id") || "satyam045@fam (default)";28    var currentKey0 = Bot.getProperty("payment_api_key");29    var currentKeyDisplay0 = currentKey0 ? (currentKey0.substring(0, 10) + "••••••••") : "FAM_0d41dd••••• (default)";30    Bot.sendMessage(31      "⚠️ <b>Format:</b> <code>/set_payment_upi yourid@fam|FAM_xxxx</code>\n" +32      "<i>(sirf UPI change karna ho to:</i> <code>/set_payment_upi yourid@fam</code><i>)</i>\n\n" +33      "<b>Current UPI ID:</b> <code>" + currentUpi0 + "</code>\n" +34      "<b>Current API Key:</b> <code>" + currentKeyDisplay0 + "</code>",35      { parse_mode: "HTML" }36    );37    return;38  }39 40  var rawInput = params.trim();41  var inputParts = rawInput.split("|");42  var newUpi = inputParts[0].trim();43  var newApiKey = (inputParts.length > 1) ? inputParts[1].trim() : null;44 45  if (newUpi.indexOf("@") === -1 || newUpi.indexOf(" ") !== -1) {46    Bot.sendMessage("❌ Invalid UPI ID! Format jaisa hona chahiye: <code>name@bank</code>", { parse_mode: "HTML" });47    return;48  }49  if (newApiKey !== null && (newApiKey === "" || newApiKey.indexOf(" ") !== -1)) {50    Bot.sendMessage("❌ Invalid API Key! Space allowed nahi hai.", { parse_mode: "HTML" });51    return;52  }53 54  Bot.setProperty("payment_upi_id", newUpi, "string");55  var confirmMsg = "✅ <b>Payment config update ho gaya:</b>\n• UPI ID: <code>" + newUpi + "</code>";56 57  if (newApiKey) {58    Bot.setProperty("payment_api_key", newApiKey, "string");59    confirmMsg += "\n• Fam Pay API Key: <code>" + newApiKey.substring(0, 10) + "••••••••</code>";60  }61 62  confirmMsg += "\n\n<i>Ab saare QR generate + payment verify isi UPI/API se honge, koi bhi purana flow break nahi hoga.</i>";63  Bot.sendMessage(confirmMsg, { parse_mode: "HTML" });64 65} catch (err) {66  Bot.sendMessage("⚠️ Error: " + err.message);67}