mahdiyar30301/ZorenixAI_botPublic · Bot Template

Not Bot Is Hacking You 🤣🤩

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

commands/check_join.js

javascript · 87 lines

Raw
1/**#command2name: check_join3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: check_join14answer: 15keyboard: 16parse_mode: 17aliases: 18allow_only_group: false19need_reply: false20is_web: 021#command**/22 23try {24var uid = "";25var uidB = "";26if (typeof user !== "undefined" && user) {27  if (user.telegramid) uid = String(user.telegramid);28  if (user.id) uidB = String(user.id);29}30if (!uid && uidB) uid = uidB;31try {32  if (!uid && typeof update !== "undefined" && update && update.callback_query && update.callback_query.from) {33    uid = String(update.callback_query.from.id);34  }35} catch (eU) {}36if (!uid) { Bot.sendMessage("شناسه نیست"); return; }37 38var isBoss = (uid === "5861439682") || (uidB === "5861439682");39var isAdmin = isBoss || ((await db.global.get("rank_" + uid)) === "admin");40if (isAdmin) {41  await db.global.set("join_ok_" + uid, "3");42  if (uidB) await db.global.set("join_ok_" + uidB, "3");43  try { Api.answerCallbackQuery({ text: "ادمین", show_alert: false }); } catch (eA) {}44  Bot.runCommand("/start");45  return;46}47 48var chs = ["@ZorenixStudio", "@ZorenixFF", "@ZorenixNews"];49var allOk = true;50var miss = "";51var ci = 0;52for (ci = 0; ci < 3; ci++) {53  var mem = false;54  try {55    var res = await Api.getChatMember({ chat_id: chs[ci], user_id: uid });56    var st = "";57    if (res && res.result && res.result.status) st = String(res.result.status);58    else if (res && res.status) st = String(res.status);59    if (st === "member" || st === "administrator" || st === "creator" || st === "restricted") mem = true;60  } catch (e1) {}61  if (!mem) {62    allOk = false;63    if (miss) miss = miss + " ";64    miss = miss + chs[ci];65  }66}67 68if (!allOk) {69  try { Api.answerCallbackQuery({ text: "هنوز عضو نیستی: " + miss, show_alert: true }); } catch (e2) {}70  try { Bot.runCommand("joingate"); } catch (eG) {}71  return;72}73 74await db.global.set("join_ok_" + uid, "3");75if (uidB) await db.global.set("join_ok_" + uidB, "3");76try { Api.answerCallbackQuery({ text: "هر ۳ کانال تایید شد", show_alert: false }); } catch (e3) {}77 78var rok = await db.global.get("rules_ok_" + uid);79if ((!rok || rok === "0") && uidB) rok = await db.global.get("rules_ok_" + uidB);80if (rok !== "1" && rok !== 1 && rok !== true) {81  Bot.runCommand("rol");82  return;83}84Bot.runCommand("/start");85} catch (e) {86  Bot.sendMessage("خطا check_join");87}