mansuriamaan803/SANJEEVFFSTORE_botPublic · Bot Template

AIThis bot is a commerce platform for selling digital products, primarily focused on FreeFire accounts and related services. It provides admin tools for managing products, categories, stock, reseller roles, and a balance system for user payments. Users can browse products, apply coupons, and check their balance through an interactive interface with premium emojis and inline keyboards.

Commercecommercestoreproductsresellerbalancecoupon
ProfileTelegram
102 commands0 envUpdated 12d agoCreated Aug 26, 2026
Back to folder

commands/_setresellerprice.js

javascript · 50 lines

Raw
1/**#command2name: /setresellerprice3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 💰 COMMAND = /setresellerprice14// STATUS: 100% ACCURATE KEY MATCHING FIX15// =========================================================16 17var input = message.replace("/setresellerprice", "").trim(); 18var parts = input.split("|");19 20if (parts.length === 3) {21  // 1️⃣ PRODUCT NAME: UpperCase + Trim (Jaise main buyitem script me hai)22  var pName = parts[0].trim().toUpperCase(); 23  24  // 2️⃣ PLAN DAYS: Sirf number nikalenge (Jaise "7_Day" ya "7 Days" se "7" bachega)25  var pPlan = String(parts[1]).replace(/[^0-9]/g, "").trim(); 26  27  // 3️⃣ PRICE: Force Floating/Integer Number parsing28  var pPrice = parseFloat(parts[2].trim());29 30  if (isNaN(pPrice)) {31    Bot.sendMessage("❌ Price ek number hona chahiye!");32    return;33  }34 35  // 🔥 MAIN MATCHING KEY FIX: direct buyitem loop database properties alignment36  var targetDatabaseKey = "price_reseller_" + pName + "_" + pPlan;37 38  // Real number me save karenge taaki exact math response aaye39  Bot.setProperty(targetDatabaseKey, pPrice, "number");40  41  Bot.sendMessage("✅ <b>Reseller Price Updated Successfully!</b>\n\n" +42                  "📦 <b>Product:</b> <code>" + pName + "</code>\n" +43                  "⏱️ <b>Plan:</b> <code>" + pPlan + " Days</code>\n" +44                  "💵 <b>New Price:</b> ₹" + pPrice, { parse_mode: "HTML" });45 46} else {47  Bot.sendMessage("⚠️ <b>Galat Format!</b>\n\n" +48                  "📝 <b>Format:</b>\n<code>/setresellerprice PRODUCT NAME | DAYS | PRICE</code>\n\n" +49                  "💡 <b>Example:</b>\n<code>/setresellerprice PRIME HOOK | 7 | 64</code>", { parse_mode: "HTML" });50}