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

javascript · 92 lines

Raw
1/**#command2name: /addbal_upi_manual3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// ✋ MANUAL UPI PAYMENT SCREEN — shown instead of the Fampay auto-QR when14// admin has "UPI Payment Mode" set to Manual. QR banaya jaata hai apni UPI15// ID se dynamically (public qrserver.com image API — koi payment gateway16// nahi, sirf QR CODE ki IMAGE banata hai), user "I Paid" dabakar screenshot17// bhejta hai, jo seedha admin ko Approve/Reject button ke saath jaata hai.18// =========================================================19 20try {21  let userId = user.telegramid;22  let finalAmount = String(parseInt(params ? String(params).trim() : "0"));23 24  if (!finalAmount || finalAmount === "0" || isNaN(parseInt(finalAmount)) || parseInt(finalAmount) <= 0) {25    Bot.sendMessage("❌ Invalid amount!");26    return;27  }28 29  let upiId = Bot.getProperty("payment_upi_id") || "ayushrds@nyes";30  let payeeName = Bot.getProperty("bot_name") || "GOLDEN MODS STORE";31 32  User.setProperty("upi_manual_pending_amount", finalAmount, "string");33 34  let upiUri = "upi://pay?pa=" + encodeURIComponent(upiId) +35               "&pn=" + encodeURIComponent(payeeName) +36               "&am=" + encodeURIComponent(finalAmount) +37               "&cu=INR";38  let qrImageUrl = "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=" + encodeURIComponent(upiUri);39 40  let e_upi = "💳";41  let e_check = "✔️";42 43  let caption =44    "<blockquote>" + e_upi + " <b>UPI PAY — ₹" + finalAmount + "</b></blockquote>\n" +45    "━━━━━━━━━━━━━━━━━━━━━\n\n" +46    "💰 <b>Amount:</b> ₹<code>" + finalAmount + "</code>\n\n" +47    "<b>UPI ID</b>\n<code>" + upiId + "</code>\n\n" +48    "━━━━━━━━━━━━━━━━━━━━━\n" +49    "📋 <b>Instructions</b>\n" +50    "• Scan the QR above with any UPI app, or pay to the UPI ID.\n" +51    "• Pay the <b>exact</b> amount shown.\n" +52    "• Tap <b>I Paid</b> below and send your payment screenshot.\n\n" +53    e_check + " <i>Admin will verify and credit your balance manually.</i>";54 55  let inlineButtons = [56    [{ text: "I Paid", callback_data: "/addbal_upi_manual_paid", style: "success", icon_custom_emoji_id: "6100657257605763582" }],57    [{ text: "Cancel", callback_data: "/cancel_topup", style: "danger", icon_custom_emoji_id: "6219547832169273793" }]58  ];59 60  // Agar purani "Generating..." message hai, use hata do61  try {62    let genMsgId = Bot.getProperty("gen_msg_id_" + userId) || User.getProperty("gen_msg_id_" + userId);63    if (genMsgId) {64      try { Api.deleteMessage({ chat_id: chat.chatid, message_id: genMsgId }); } catch (e) {}65      Bot.setProperty("gen_msg_id_" + userId, null, "string");66      User.setProperty("gen_msg_id_" + userId, null, "string");67    }68  } catch (e) {}69 70  if (request && request.message && !request.message.photo) {71    try { Api.deleteMessage({ chat_id: chat.chatid, message_id: request.message.message_id }); } catch (e) {}72  }73 74  let sentMsg = Api.sendPhoto({75    chat_id: chat.chatid,76    photo: qrImageUrl,77    caption: caption,78    parse_mode: "HTML",79    reply_markup: JSON.stringify({ inline_keyboard: inlineButtons })80  });81 82  try {83    let qrMsgId = (sentMsg && sentMsg.result && sentMsg.result.message_id) ? sentMsg.result.message_id : (sentMsg && sentMsg.message_id ? sentMsg.message_id : null);84    if (qrMsgId) {85      Bot.setProperty("qr_msg_id_" + userId, qrMsgId, "string");86      User.setProperty("qr_msg_id_" + userId, qrMsgId, "string");87    }88  } catch (e) {}89 90} catch (err) {91  Bot.sendMessage("⚠️ System Error: " + err.message);92}