455 commands2 envUpdated 6h agoCreated Aug 26, 2026
commands/apok.js
javascript · 54 lines
1/**#command2name: apok3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: apok14answer: 15keyboard: 16parse_mode: markdown17aliases: 18allow_only_group: false19need_reply: false20is_web: 021#command**/22 23try {24try { Api.answerCallbackQuery({ text: "ثبت شد" }); } 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 !== "5861439682") return;31var tid = String((await db.global.get("adm_tgt_" + uid)) || "");32if (!tid) { Bot.sendMessage("آیدی نیست"); return; }33var perms = String((await db.global.get("perms_" + tid)) || "");34if (!perms) { Bot.sendMessage("اول حداقل یک تیک بزن، بعد تایید."); return; }35await db.global.set("rank_" + tid, "admin");36await db.global.set("perms_" + tid, perms);37var ids = [];38try { ids = JSON.parse(String((await db.global.get("adm_ids")) || "[]")); } catch (eI) { ids = []; }39if (!ids || typeof ids.length !== "number") ids = [];40var found = false;41var i = 0;42for (i = 0; i < ids.length; i++) { if (String(ids[i]) === tid) found = true; }43if (!found) ids.push(tid);44await db.global.set("adm_ids", JSON.stringify(ids));45Bot.sendMessage("✅ ادمین شد: " + tid + "\nدسترسی: " + perms);46try {47 Api.sendMessage({48 chat_id: tid,49 text: "🎉 مدیر سیستم شدی.\nدسترسی: " + perms + "\nپنل: /panel"50 });51} catch (eS) {}52} catch (e) {53 Bot.sendMessage("خطا apok");54}