mahdiyar30301/ZorenixAI_botPublic · Bot Template

Not Bot Is Hacking You 🤣🤩

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

commands/clntop.js

javascript · 67 lines

Raw
1/**#command2name: clntop3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: clntop14answer: 15keyboard: 16parse_mode: 17aliases: 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}30if (!uid) return;31 32var nid = parseInt(await db.global.get("clan_nid") || 1) || 1;33var rows = [];34var i = 1;35for (i = 1; i < nid && i < 80; i++) {36  var raw = String((await db.global.get("clan_" + i)) || "");37  if (!raw) continue;38  var cl = {};39  try { cl = JSON.parse(raw); } catch (e1) { cl = {}; }40  if (!cl || !cl.n) continue;41  var mc = 0;42  if (cl.M && typeof cl.M.length === "number") mc = cl.M.length;43  rows.push({ n: String(cl.n), xp: parseInt(cl.xp) || 0, m: mc });44}45var p = 0;46var q = 0;47for (p = 0; p < rows.length; p++) {48  for (q = p + 1; q < rows.length; q++) {49    if (rows[q].xp > rows[p].xp) { var t = rows[p]; rows[p] = rows[q]; rows[q] = t; }50  }51}52var out = "🏆 برترین کلن‌ها\n───────────────\n";53var k = 0;54var lim = rows.length;55if (lim > 10) lim = 10;56if (!lim) out = out + "خالی\n";57for (k = 0; k < lim; k++) {58  out = out + (k + 1) + ") " + rows[k].n + " · XP " + rows[k].xp + " · " + rows[k].m + " نفر\n";59}60Api.sendMessage({61  text: out,62  reply_markup: { inline_keyboard: [63    [{ text: "🏰 کلن من", callback_data: "cln" }, { text: "✨ پلاس", callback_data: "plus" }]64  ] }65});66 67} catch (e) { Bot.sendMessage("خطا clntop"); }