indrajitghosh20006/Testseller_01botPublic · Bot Template

ProfileTelegram

AIThis bot provides an admin‑controlled system for managing user balances, products, and reseller roles. It includes commands to add balances (via manual input, Binance Pay, or UPI), approve and credit payments, and set up product listings with categories and pricing. Admins can also add resellers, view reseller info, and manage stock entries. The bot uses built‑in TeleBotHost APIs such as Bot, Api, HTTP, and Libs for database operations and message handling.

Commerceadminbalanceproductresellerpaymentsbinance
138 commands0 envUpdated 17h agoCreated Sep 27, 2026
Back to folder

commands/_addfund.js

javascript · 104 lines

Raw
1/**#command2name: /addfund3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 💰 COMMAND = Initial Deposit Keypad Setup14// STATUS: ✅ PREMIUM CALCULATOR UI — colored buttons + premium emojis15// (kept in sync with /press.js so the screen never "flickers"/changes16// style when the user presses the first digit)17// =========================================================18 19try {20  // Amount ko shuru me 0 set karein21  User.setProperty("deposit_amount", "0", "string");22 23  // 💎 Premium Emoji Set — user-provided premium IDs applied across this screen24  let e_money   = "<tg-emoji emoji-id='6312263493051489212'>💰</tg-emoji>";25  let e_clear   = "<tg-emoji emoji-id='5348224471050238603'>✏</tg-emoji>";26  let e_confirm = "<tg-emoji emoji-id='5348191451341668809'>✅</tg-emoji>";27  let e_back    = "<tg-emoji emoji-id='5893163582194978381'>⬅️</tg-emoji>";28  let e_hour    = "<tg-emoji emoji-id='6100657257605763582'>✔️</tg-emoji>";29  let e_check   = "<tg-emoji emoji-id='6311870645277825763'>✔️</tg-emoji>";30 31  // 🎨 Main message — premium "Enter Custom Amount" calculator screen32  let msg =33    "<blockquote>" + e_money + " <b>ADD BALANCE — ENTER AMOUNT</b> <tg-emoji emoji-id='6312263493051489212'>💎</tg-emoji></blockquote>\n" +34    "━━━━━━━━━━━━━━━━━━━━━\n\n" +35    "<tg-emoji emoji-id='6312263493051489212'>💎</tg-emoji> <b>Amount:</b> ₹<code>0</code>\n\n" +36    "━━━━━━━━━━━━━━━━━━━━━\n" +37    e_check + " <i>Instant Auto-Credit</i>\n" +38    "<tg-emoji emoji-id='6215386799133433653'>🔒</tg-emoji> <i>100% Secure UPI Payment</i>\n" +39    e_hour + " <i>Verified in Seconds</i>\n\n" +40    "<tg-emoji emoji-id='6100170496077204999'>👑</tg-emoji> <i>Use the keypad below to enter amount</i>";41 42  // 🎨 Styled keyboard payload — blue number pad, red clear/back, green confirm43  let keyboard = [44    [45      { text: "1", callback_data: "/press 1", style: "primary" },46      { text: "2", callback_data: "/press 2", style: "primary" },47      { text: "3", callback_data: "/press 3", style: "primary" }48    ],49    [50      { text: "4", callback_data: "/press 4", style: "primary" },51      { text: "5", callback_data: "/press 5", style: "primary" },52      { text: "6", callback_data: "/press 6", style: "primary" }53    ],54    [55      { text: "7", callback_data: "/press 7", style: "primary" },56      { text: "8", callback_data: "/press 8", style: "primary" },57      { text: "9", callback_data: "/press 9", style: "primary" }58    ],59    [60      { text: "Clear", callback_data: "/press clear", style: "danger", icon_custom_emoji_id: "5348224471050238603" },61      { text: "0", callback_data: "/press 0", style: "primary" },62      { text: "Confirm", callback_data: "/press confirm", style: "success", icon_custom_emoji_id: "5348191451341668809" }63    ],64    [65      { text: "Back", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }66    ]67  ];68 69  // 'request.message' check karta hai ki kya ye kisi button click se trigger hua hai70  // ✅ BUG FIX: agar previous message ek PHOTO thi (jaise DP-attached Profile),71  // editMessageText kaam nahi karta — isi wajah se Profile se "Add Fund" click72  // karne par deposit screen aati hi nahi thi. Ab photo ho to delete + fresh send.73  if (request && request.message && request.message.message_id) {74    if (request.message.photo) {75      try { Api.deleteMessage({ chat_id: chat.chatid, message_id: request.message.message_id }); } catch (delErr) {}76      Api.sendMessage({77        chat_id: chat.chatid,78        text: msg,79        parse_mode: "HTML",80        reply_markup: JSON.stringify({ inline_keyboard: keyboard })81      });82    } else {83      // Alag se naya message nahi bhejega, usi menu ko edit karke keypad bana dega84      Api.editMessageText({85        chat_id: chat.chatid,86        message_id: request.message.message_id,87        text: msg,88        parse_mode: "HTML",89        reply_markup: JSON.stringify({ inline_keyboard: keyboard })90      });91    }92  } else {93    // Agar direct command run hua toh naya message bhejega safety ke liye94    Api.sendMessage({95      chat_id: chat.chatid,96      text: msg,97      parse_mode: "HTML",98      reply_markup: JSON.stringify({ inline_keyboard: keyboard })99    });100  }101 102} catch (err) {103  Bot.sendMessage("⚠️ System Error: " + err.message);104}