pnxh2371/Ankit_mods_store_botPublic · Bot Template

ProfileTelegram

AI𝐀ɴᴋɪᴛ 𝐌ᴏᴅꜱ 𝐒ᴛᴏʀᴇ 🛍 appears to be a Telegram automation bot. Commands include /*, /addbal, /addbal_all, /addbal_binance, /addbal_binance_approve, /addbal_binance_paid, /addbal_upi, /addcat_id. Observed in code: messaging, http, libs, keyboards, payments.

Utilityutility
133 commands0 envUpdated 7h agoCreated Sep 10, 2026
Back to folder

commands/_set_refer_earn.js

javascript · 60 lines

Raw
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") || "6182067327";19  var requesterId = String(user.telegramid);20  var isCoAdmin0 = Bot.getProperty("co_admin_" + requesterId);21  if (requesterId !== String(adminId) && !isCoAdmin0) {22    Bot.sendMessage("❌ You are not the admin!");23    return;24  }25 26  if (!params || params.trim() === "" || params.indexOf("|") === -1) {27    var topupAmt = Bot.getProperty("refer_earn_topup_amount");28    if (topupAmt === undefined || topupAmt === null) topupAmt = "2 (default)";29    var buyAmt = Bot.getProperty("refer_earn_buy_amount");30    if (buyAmt === undefined || buyAmt === null) buyAmt = "2 (default)";31    Bot.sendMessage(32      "⚠️ <b>Format:</b> <code>/set_refer_earn 2|2</code> (topup_bonus|buy_bonus)\n\n" +33      "<b>Current:</b> Topup ₹" + topupAmt + " | Buy ₹" + buyAmt,34      { parse_mode: "HTML" }35    );36    return;37  }38 39  var parts = params.trim().split("|");40  var newTopup = Number(parts[0]);41  var newBuy = Number(parts[1]);42 43  if (isNaN(newTopup) || newTopup < 0 || isNaN(newBuy) || newBuy < 0) {44    Bot.sendMessage("❌ Invalid amount! Format: <code>2|2</code>", { parse_mode: "HTML" });45    return;46  }47 48  Bot.setProperty("refer_earn_topup_amount", newTopup, "number");49  Bot.setProperty("refer_earn_buy_amount", newBuy, "number");50 51  Bot.sendMessage(52    "✅ <b>Refer & Earn amounts update ho gaye:</b>\n" +53    "• Balance-Add Bonus: ₹" + newTopup.toFixed(2) + "\n" +54    "• Purchase Bonus: ₹" + newBuy.toFixed(2),55    { parse_mode: "HTML" }56  );57 58} catch (err) {59  Bot.sendMessage("⚠️ Error: " + err.message);60}