ayushyadav7970824760/goldensellingstore_botPublic · Bot Template

AIThis Telegram store bot lets customers browse digital products and plans, apply coupons, add funds via UPI, and receive purchased keys. It includes a full admin panel for managing products, reordering items, setting reseller prices, viewing and removing key stock, configuring UPI payment details and update links, and checking user balances. Co-admins and resellers are supported, and support tickets are forwarded to the admin.

Commercedigital_storeadmin_panelupi_paymentsresellercouponskey_stock
ProfileTelegram
146 commands0 envUpdated 2d agoCreated Sep 5, 2026
Back to folder

commands/_toggle_upi_mode.js

javascript · 64 lines

Raw
1/**#command2name: /toggle_upi_mode3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🔀 ADMIN PANEL — Toggle between AUTO (Fampay auto-verify) and MANUAL14// (admin approves every UPI payment by hand) modes.15// Property: "upi_payment_mode" = "auto" (default) | "manual"16// =========================================================17 18try {19  var adminId = Bot.getProperty("owner_id") || "8477746023";20  var isCoAdmin0 = Bot.getProperty("co_admin_" + String(chat.chatid));21  if (String(chat.chatid) !== adminId && !isCoAdmin0) {22    Bot.sendMessage("❌ You are not authorized to use this.");23    return;24  }25 26  var currentMode = Bot.getProperty("upi_payment_mode") || "auto";27  var newMode = (currentMode === "auto") ? "manual" : "auto";28  Bot.setProperty("upi_payment_mode", newMode, "string");29 30  var text;31  if (newMode === "auto") {32    text =33      "<blockquote>✅ <b>UPI Mode: AUTOMATIC (Fampay)</b></blockquote>\n\n" +34      "<i>Payments Fampay API se khud-ba-khud verify aur credit ho jaayenge — jaise pehle hota tha.</i>";35  } else {36    text =37      "<blockquote>✋ <b>UPI Mode: MANUAL APPROVAL</b></blockquote>\n\n" +38      "<i>Ab har UPI payment ke liye user ko QR + \"I Paid\" button milega. User screenshot bhejega, aapko \"✅ Approve\" / \"❌ Reject\" button ke saath message milega — aap khud verify karke balance credit karenge.</i>\n\n" +39      "<b>Zaroori:</b> <code>/set_payment_upi</code> se apni real UPI ID zaroor set kar lein (agar nahi ki hai), warna galat UPI ID pe QR banega.";40  }41 42  var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;43 44  if (request && request.message && request.message.message_id) {45    try {46      Api.editMessageText({47        chat_id: String(chat.chatid),48        message_id: Number(request.message.message_id),49        text: text,50        parse_mode: "HTML",51        reply_markup: JSON.stringify({ inline_keyboard: [[{ text: "Back to Admin Panel", callback_data: "/admin", style: "danger" }]] })52      });53    } catch (e) {54      Api.sendMessage({ chat_id: chat.chatid, text: text, parse_mode: "HTML" });55    }56  } else {57    Bot.sendMessage(text, { parse_mode: "HTML" });58  }59 60  if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: String(queryId), text: "UPI mode: " + newMode.toUpperCase() }); } catch (e) {} }61 62} catch (err) {63  Bot.sendMessage("⚠️ Error: " + err.message);64}