mahdiyar30301/ZorenixAI_botPublic · Bot Template

Not Bot Is Hacking You 🤣🤩

Utilityutility
ProfileTelegram
455 commands2 envUpdated 7h agoCreated Aug 26, 2026
Back to folder

commands/wddel.js

javascript · 55 lines

Raw
1/**#command2name: wddel3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: wddel14answer: 15keyboard: 16parse_mode: markdown17aliases: 18allow_only_group: false19need_reply: false20is_web: 021#command**/22 23try {24try { Api.answerCallbackQuery({}); } catch (e0) {}25var uid = "";26if (typeof user !== "undefined" && user) {27  if (user.telegramid) uid = String(user.telegramid);28  else if (user.id) uid = String(user.id);29}30var isBoss = (uid === "5861439682");31var isAdmin = isBoss || ((await db.global.get("rank_" + uid)) === "admin");32if (!isAdmin) { Bot.sendMessage("فقط ادمین."); return; }33var num = 0;34if (typeof params !== "undefined" && params) num = parseInt(String(params).replace(/[^0-9]/g, "")) || 0;35var list = [];36try { list = JSON.parse(String((await db.global.get("msn_list")) || "[]")); } catch (eL) { list = []; }37if (!list || typeof list.length !== "number") list = [];38if (num < 1) {39  var t = "حذف:\n/wddel شماره\n";40  var i = 0;41  for (i = 0; i < list.length && i < 20; i++) t = t + (i + 1) + ") " + String(list[i].title || "") + "\n";42  Bot.sendMessage(t);43  return;44}45var ix = num - 1;46if (ix < 0 || ix >= list.length) { Bot.sendMessage("شماره نیست."); return; }47var old = String(list[ix].title || "");48var nxt = [];49var j = 0;50for (j = 0; j < list.length; j++) { if (j !== ix) nxt.push(list[j]); }51await db.global.set("msn_list", JSON.stringify(nxt));52Bot.sendMessage("🗑 حذف شد: " + old + "\nمانده: " + nxt.length);53} catch (e) {54  Bot.sendMessage("خطا wddel");55}