devbro468/Dev_x_store_botPublic · Bot Template

AIThis bot operates a digital storefront (DEV X STORE) selling subscription-based products — likely game hacks, accounts, or access keys — categorized by platform (Android Root, Non-Root, iPhone). It features a reseller program with discounted pricing, a dual-currency wallet (INR balance + Telegram Stars/XTR), and a full admin/co-admin panel for managing products, plans, per-plan pricing, stock (keys/accounts), coupons, and API endpoints. Purchases flow through a plan selection screen offering wallet payment, Stars invoices (sendInvoice with XTR currency), and coupon application. Successful Stars payments are handled via successful_payment webhook, crediting wallet or delivering keys directly. Admin tools include user listing with chunked messaging, stock viewing/deletion with inline keyboards, co-admin management, and API registry updates. The bot registers users on first interaction and

Commercecommercedigital-goodsstars-paymentreseller-systemadmin-panelstock-management
ProfileTelegram
119 commands0 envUpdated 15d agoCreated Aug 23, 2026
Back to folder

commands/_set_payment_upi_btn.js

javascript · 65 lines

Raw
1/**#command2name: /set_payment_upi_btn3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 💳 ADMIN PANEL BUTTON — "Set Payment UPI"14// Pressing this button prompts the admin to send the new UPI ID as a15// normal text message next; _start.js (MODULE 5) auto-captures that16// reply and forwards it to /set_payment_upi internally.17// =========================================================18 19try {20  var adminId = Bot.getProperty("owner_id") || "8875810358";21  var currentChatId = String(chat.chatid);22  var isCoAdmin = Bot.getProperty("co_admin_" + currentChatId);23 24  if (currentChatId !== adminId && !isCoAdmin) {25    Bot.sendMessage("❌ You are not authorized to use this.");26    return;27  }28 29  var currentUpi = Bot.getProperty("payment_upi_id") || "galureang@fam (default)";30  var currentApiKey = Bot.getProperty("payment_api_key");31  var currentApiKeyDisplay = currentApiKey ? (currentApiKey.substring(0, 10) + "••••••••") : "FAM_b47c7d••••• (default)";32 33  User.setProperty("set_payment_upi_step", "waiting_input", "string");34 35  var promptText =36    "<blockquote><tg-emoji emoji-id='6312263493051489212'>💳</tg-emoji> <b>Set Payment (Fam Pay) Config</b></blockquote>\n\n" +37    "<i>Is format me reply karein:</i>\n<code>upi_id|api_key</code>\n\n" +38    "<i>Example:</i> <code>yourid@fam|FAM_xxxxxxxxxxxxxxxx</code>\n\n" +39    "<i>Sirf UPI change karna ho to bhi pura format bhejein, api_key ko wahi purana daal dein. Agar sirf ek cheez bhejenge (bina | ke), sirf UPI ID update hogi.</i>\n\n" +40    "<b>Current UPI ID:</b> <code>" + currentUpi + "</code>\n" +41    "<b>Current API Key:</b> <code>" + currentApiKeyDisplay + "</code>";42 43  var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;44 45  if (request && request.message && request.message.message_id) {46    try {47      Api.editMessageText({48        chat_id: String(chat.chatid),49        message_id: Number(request.message.message_id),50        text: promptText,51        parse_mode: "HTML",52        reply_markup: JSON.stringify({ inline_keyboard: [[{ text: "Cancel", callback_data: "/admin", style: "danger" }]] })53      });54    } catch (e) {55      Api.sendMessage({ chat_id: chat.chatid, text: promptText, parse_mode: "HTML" });56    }57  } else {58    Bot.sendMessage(promptText, { parse_mode: "HTML" });59  }60 61  if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {} }62 63} catch (err) {64  Bot.sendMessage("⚠️ Error: " + err.message);65}