indrajitghosh20006/Testseller_01botPublic · Bot Template
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
commands/_set_refer_earn.js
javascript · 59 lines
1/**#command2name: /set_refer_earn3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🔧 ADMIN — Configure the Refer & Earn bonus amounts14// Usage: /set_refer_earn 2|2 (topup_bonus|buy_bonus)15// =========================================================16 17try {18 var adminId = Bot.getProperty("owner_id") || "7839151435";19 var isCoAdmin0 = Bot.getProperty("co_admin_" + String(chat.chatid));20 if (String(chat.chatid) !== adminId && !isCoAdmin0) {21 Bot.sendMessage("❌ You are not the admin!");22 return;23 }24 25 if (!params || params.trim() === "" || params.indexOf("|") === -1) {26 var topupAmt = Bot.getProperty("refer_earn_topup_amount");27 if (topupAmt === undefined || topupAmt === null) topupAmt = "2 (default)";28 var buyAmt = Bot.getProperty("refer_earn_buy_amount");29 if (buyAmt === undefined || buyAmt === null) buyAmt = "2 (default)";30 Bot.sendMessage(31 "⚠️ <b>Format:</b> <code>/set_refer_earn 2|2</code> (topup_bonus|buy_bonus)\n\n" +32 "<b>Current:</b> Topup ₹" + topupAmt + " | Buy ₹" + buyAmt,33 { parse_mode: "HTML" }34 );35 return;36 }37 38 var parts = params.trim().split("|");39 var newTopup = Number(parts[0]);40 var newBuy = Number(parts[1]);41 42 if (isNaN(newTopup) || newTopup < 0 || isNaN(newBuy) || newBuy < 0) {43 Bot.sendMessage("❌ Invalid amount! Format: <code>2|2</code>", { parse_mode: "HTML" });44 return;45 }46 47 Bot.setProperty("refer_earn_topup_amount", newTopup, "number");48 Bot.setProperty("refer_earn_buy_amount", newBuy, "number");49 50 Bot.sendMessage(51 "✅ <b>Refer & Earn amounts update ho gaye:</b>\n" +52 "• Balance-Add Bonus: ₹" + newTopup.toFixed(2) + "\n" +53 "• Purchase Bonus: ₹" + newBuy.toFixed(2),54 { parse_mode: "HTML" }55 );56 57} catch (err) {58 Bot.sendMessage("⚠️ Error: " + err.message);59}