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
146 commands0 envUpdated 2d agoCreated Sep 5, 2026
commands/_addbal_upi_manual_reject.js
javascript · 91 lines
1/**#command2name: /addbal_upi_manual_reject3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// ❌ ADMIN — "Reject" button on a Manual UPI submission.14// =========================================================15 16try {17 var adminId = Bot.getProperty("owner_id") || "8477746023";18 var isCoAdmin0 = Bot.getProperty("co_admin_" + String(chat.chatid));19 if (String(chat.chatid) !== adminId && !isCoAdmin0) {20 Bot.sendMessage("❌ You are not authorized to use this.");21 return;22 }23 24 var callbackId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;25 26 // ✅ FIXED: same short-token lookup as approve27 var approvalToken = params ? String(params).trim() : "";28 var approvalData = null;29 try { approvalData = JSON.parse(Bot.getProperty("upi_appr_" + approvalToken) || "null"); } catch (e) {}30 31 if (!approvalData) {32 if (callbackId) {33 Api.answerCallbackQuery({ callback_query_id: String(callbackId), text: "❌ Order expired or already handled.", show_alert: true });34 }35 return;36 }37 38 var targetId = approvalData.userId;39 var amount = approvalData.amount || "0";40 var orderIdRef = approvalData.orderId || null;41 42 if (!targetId) {43 if (callbackId) {44 Api.answerCallbackQuery({ callback_query_id: String(callbackId), text: "❌ Invalid data.", show_alert: true });45 }46 return;47 }48 49 if (request && request.message && request.message.message_id) {50 try {51 Api.editMessageText({52 chat_id: chat.chatid,53 message_id: request.message.message_id,54 text: (request.message.text || "") + "\n\n<blockquote>❌ <b>REJECTED</b></blockquote>",55 parse_mode: "HTML"56 });57 } catch (e) {}58 }59 60 // ✅ User ke paas jo QR wali message thi, use bhi DELETE karo aur ek nayi61 // "Payment Rejected" message bhejo.62 if (orderIdRef) {63 try {64 var qrRef = JSON.parse(Bot.getProperty("qr_msg_ref_" + orderIdRef) || "null");65 if (qrRef && qrRef.chatId && qrRef.msgId) {66 try { Api.deleteMessage({ chat_id: qrRef.chatId, message_id: qrRef.msgId }); } catch (e) {}67 }68 Bot.setProperty("qr_msg_ref_" + orderIdRef, null, "string");69 } catch (e) {}70 }71 72 try {73 Api.sendMessage({74 chat_id: targetId,75 text: "<blockquote>❌ <b>Payment Rejected</b></blockquote>\n\n" +76 "💰 <b>Amount:</b> ₹" + amount + "\n\n" +77 "<i>Aapka payment screenshot verify nahi ho paaya. Agar ye galti hai, kripya Support se contact karein.</i>",78 parse_mode: "HTML",79 reply_markup: JSON.stringify({ inline_keyboard: [[{ text: "Support", callback_data: "/support", style: "primary" }]] })80 });81 } catch (notifyErr) {}82 83 if (callbackId) {84 Api.answerCallbackQuery({ callback_query_id: String(callbackId), text: "❌ Rejected." });85 }86 87 try { Bot.setProperty("upi_appr_" + approvalToken, null, "string"); } catch (e) {}88 89} catch (err) {90 Bot.sendMessage("⚠️ Error: " + err.message);91}