455 commands2 envUpdated 6h agoCreated Aug 26, 2026
commands/rptlist.js
javascript · 49 lines
1/**#command2name: rptlist3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: rptlist14answer: 15keyboard: 16parse_mode: markdown17aliases: 18allow_only_group: false19need_reply: false20is_web: 021#command**/22 23try {24var uid = "";25if (typeof user !== "undefined" && user) {26 if (user.telegramid) uid = String(user.telegramid);27 else if (user.id) uid = String(user.id);28}29var isBoss = (uid === "5861439682");30var isAdmin = isBoss || ((await db.global.get("rank_" + uid)) === "admin");31if (!isAdmin) { Bot.sendMessage("فقط ادمین."); return; }32var box = [];33try { box = JSON.parse(String((await db.global.get("rpt_box")) || "[]")); } catch (eB) { box = []; }34if (!box || typeof box.length !== "number" || box.length === 0) { Bot.sendMessage("گزارشی نیست."); return; }35var n = 0;36var line = "🚩 گزارشها\n";37var i = 0;38for (i = box.length - 1; i >= 0; i--) {39 if (n >= 10) break;40 var r = box[i];41 if (r) {42 line = line + (n + 1) + ") از " + String(r.u || "") + " علیه " + String(r.t || "") + "\n" + String(r.w || "") + "\n";43 n += 1;44 }45}46Bot.sendMessage(line);47} catch (e) {48 Bot.sendMessage("خطا rptlist");49}