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

javascript · 57 lines

Raw
1/**#command2name: /remcat_id3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var adminId = "8963001413";14  if (!chat || String(chat.chatid) !== adminId) return;15 16  // 🛡️ CRASH FIX: Pehle check karenge ki message null toh nahi hai17  if (!message) {18    Bot.sendMessage("✍️ <b>Kripya Category ka naam text me likh kar bhejiye!</b>\n\n<b>Sahi Format:</b>\n<code>/remcat_id [Category Name]</code>\n\n<b>Example:</b>\n<code>/remcat_id Facebook Id</code>", {parse_mode: "HTML"});19    return;20  }21 22  var cleanMessage = message.trim();23 24  // Agar message me command text shuru me hai toh use clean karein25  if (cleanMessage.indexOf("/remcat_id") === 0) {26    cleanMessage = cleanMessage.replace("/remcat_id", "").trim();27  }28 29  if (!cleanMessage) {30    Bot.sendMessage("⚠️ <b>Format Galat Hai!</b>\n\n<b>Sahi Format:</b>\n<code>/remcat_id [Category Name]</code>\n\n<b>Example:</b>\n<code>/remcat_id Facebook Id</code>", {parse_mode: "HTML"});31    return;32  }33 34  // FIXED: Sahi slug creation algorithm jo addcat_id script ke bilkul same hai35  var catSlug = cleanMessage.toLowerCase().replace(/[^a-z0-9]/g, "");36  37  var categories = Bot.getProperty("ff_categories") || {};38 39  if (!categories[catSlug]) {40    Bot.sendMessage("❌ <b>Category nahi mili!</b>\n\nEk baar naam sahi se check karein ya menu me jaakar dekhein.", {parse_mode: "HTML"});41    return;42  }43 44  var oldName = categories[catSlug].name;45  46  // Category array/object se remove karein47  delete categories[catSlug];48  Bot.setProperty("ff_categories", categories, "json");49  50  // Associated stock database se completely wipe out karein51  Bot.setProperty("ff_stock_" + catSlug, null);52 53  Bot.sendMessage("🗑️ <b>Category Successfully Deleted!</b>\n\n• <b>Name:</b> <code>" + oldName + "</code>\n• <b>System Slug Wiped:</b> <code>" + catSlug + "</code>\n\n<i>Yeh category aur iska saara stock ab database se hat chuka hai.</i>", {parse_mode: "HTML"});54 55} catch(e) {56  Bot.sendMessage("Error in Remove Category: " + e.message);57}