mahdiyar30301/ZorenixAI_botPublic · Bot Template

Not Bot Is Hacking You 🤣🤩

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

commands/zctop.js

javascript · 79 lines

Raw
1/**#command2name: zctop3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: zctop14answer: 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}30if (!uid) return;31var my = (parseInt(await db.global.get("wal_" + uid) || 0) || 0) / 100;32var list = [];33try { list = JSON.parse(String((await db.global.get("z_users")) || "[]")); } catch (eL) { list = []; }34if (!list || typeof list.length !== "number") list = [];35var rows = [];36var i = 0;37var lim = list.length;38if (lim > 400) lim = 400;39for (i = 0; i < lim; i++) {40  var u = String(list[i] || "");41  if (!u) continue;42  var n = parseInt(await db.global.get("wal_" + u) || 0) || 0;43  if (n < 1) continue;44  rows.push({ u: u, n: n });45}46var a = 0;47var b = 0;48for (a = 0; a < rows.length; a++) {49  for (b = a + 1; b < rows.length; b++) {50    if (rows[b].n > rows[a].n) {51      var tmp = rows[a];52      rows[a] = rows[b];53      rows[b] = tmp;54    }55  }56}57var line = "💎 پولدارهای ZC\n────────────────\n";58if (rows.length === 0) line = line + "هنوز کیف‌ها خالی‌اند.\n";59else {60  var show = rows.length;61  if (show > 10) show = 10;62  for (i = 0; i < show; i++) {63    var mark = "▫️";64    if (i === 0) mark = "🥇";65    else if (i === 1) mark = "🥈";66    else if (i === 2) mark = "🥉";67    var tail = String(rows[i].u);68    if (tail.length > 4) tail = tail.slice(tail.length - 4);69    line = line + mark + " ***" + tail + " — " + (rows[i].n / 100) + " ZC\n";70  }71}72line = line + "\nکیف تو: " + my + " ZC\nنقد نمی‌شود.";73Api.sendMessage({74  text: line,75  reply_markup: { inline_keyboard: [[{ text: "📂 پوشه", callback_data: "fold" }, { text: "💎 کیف", callback_data: "wal" }]] }76});77} catch (e) {78  Bot.sendMessage("خطا zctop");79}