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

javascript · 63 lines

Raw
1/**#command2name: /deposit_stars3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// ⭐ TELEGRAM STARS — Deposit screen (Wallet top-up in Stars)14// Note: Stars balance is tracked SEPARATELY from the Rupee/UPI wallet,15// since Telegram Stars (XTR) is its own currency and can't be mixed 1:116// with rupee balance without a fixed conversion rate.17// =========================================================18 19try {20  var userId = String(user.telegramid);21  var chatId = chat.chatid;22  var starsBalance = Number(Bot.getProperty("stars_balance_" + userId) || 0);23 24  var text =25    "<blockquote>⭐ <b>DEPOSIT TELEGRAM STARS</b></blockquote>\n" +26    "━━━━━━━━━━━━━━━━━━━━━\n\n" +27    "⭐ <b>Current Stars Balance:</b> <code>" + starsBalance + "</code>\n\n" +28    "<i>Choose an amount below, or enter a custom amount. Payment goes through Telegram's official Stars checkout — instant &amp; secure.</i>\n" +29    "━━━━━━━━━━━━━━━━━━━━━";30 31  var buttons = [32    [33      { text: "⭐ 50", callback_data: "/send_stars_invoice deposit 50", style: "primary" },34      { text: "⭐ 100", callback_data: "/send_stars_invoice deposit 100", style: "primary" },35      { text: "⭐ 250", callback_data: "/send_stars_invoice deposit 250", style: "primary" }36    ],37    [38      { text: "⭐ 500", callback_data: "/send_stars_invoice deposit 500", style: "primary" },39      { text: "⭐ 1000", callback_data: "/send_stars_invoice deposit 1000", style: "primary" }40    ],41    [42      { text: "Custom Amount", callback_data: "/custom_stars_amount", style: "success", icon_custom_emoji_id: "6312263493051489212" }43    ],44    [45      { text: "Back to Menu", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }46    ]47  ];48 49  if (request && request.message && !request.message.photo) {50    Api.editMessageText({ chat_id: String(chatId), message_id: Number(request.message.message_id), text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: buttons }) });51  } else {52    if (request && request.message && request.message.photo) {53      try { Api.deleteMessage({ chat_id: chatId, message_id: request.message.message_id }); } catch (e) {}54    }55    Api.sendMessage({ chat_id: chatId, text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: buttons }) });56  }57 58  var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;59  if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {} }60 61} catch (err) {62  Bot.sendMessage("⚠️ Error: " + err.message);63}