mahdiyar30301/ZorenixAI_botPublic · Bot Template

Not Bot Is Hacking You 🤣🤩

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

commands/msn.js

javascript · 91 lines

Raw
1/**#command2name: msn3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: msn14answer: 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 on = String((await db.global.get("earn_on")) || "1");32if (on !== "1") { Bot.sendMessage("مأموریت خاموش است."); return; }33var list = [];34try { list = JSON.parse(String((await db.global.get("msn_list")) || "[]")); } catch (eL) { list = []; }35if (!list || typeof list.length !== "number") list = [];36if (list.length === 0) { Bot.sendMessage("مأموریتی نیست.\nادمین: /msnset عنوان | 50000"); return; }37var page = parseInt(await db.global.get("msn_pg_" + uid) || 0) || 0;38var per = 5;39var maxp = Math.floor((list.length - 1) / per);40if (page < 0) page = 0;41if (page > maxp) page = maxp;42await db.global.set("msn_pg_" + uid, page);43await db.global.set("msn_open_" + uid, "1");44var bname = "ZorenixAI_bot";45try { if (typeof bot !== "undefined" && bot && bot.username) bname = String(bot.username); } catch (eB) {}46var start = page * per;47var txt = "📌 مأموریت‌ها — صفحه " + (page + 1) + "/" + (maxp + 1) + "\n────────────────\n";48var i = 0;49var row = [];50var linkrow = [];51for (i = 0; i < per; i++) {52  var ix = start + i;53  if (ix >= list.length) break;54  var m = list[ix];55  var n = ix + 1;56  txt = txt + n + ") " + String(m.title || "") + "\n💰 " + (parseInt(m.pay) || 0) + " تومان\n";57  var dshow = String(m.desc || "");58  var u = String(m.url || "");59  if (!u) {60    var hi = dshow.indexOf("http");61    if (hi < 0) hi = dshow.toLowerCase().indexOf("t.me/");62    if (hi >= 0) {63      var rest = dshow.slice(hi);64      var spu = rest.indexOf(" ");65      u = spu > 0 ? rest.slice(0, spu) : rest;66      dshow = dshow.slice(0, hi).trim();67    }68  } else {69    var hi2 = dshow.indexOf("http");70    if (hi2 >= 0) dshow = dshow.slice(0, hi2).trim();71  }72  if (u && u.indexOf("http") !== 0) u = "https://" + u;73  if (dshow.length > 180) dshow = dshow.slice(0, 180) + "...";74  if (dshow) txt = txt + dshow + "\n";75  txt = txt + "\n";76  var go = "https://t.me/" + bname + "?start=msn_" + n;77  row.push({ text: "📌 " + n, url: go });78  if (u && u.indexOf("http") === 0) linkrow.push({ text: "🔗 " + n, url: u });79}80txt = txt + "دکمه شماره مأموریت را بزن (نه خود متن). بعد اسکرین بفرست.";81var kb = [row];82if (linkrow.length) kb.push(linkrow);83var nav = [];84if (page > 0) nav.push({ text: "⬅️ قبل", callback_data: "msnp" });85if (page < maxp) nav.push({ text: "بعد ➡️", callback_data: "msnn" });86if (nav.length) kb.push(nav);87kb.push([{ text: "💰 کسب درآمد", callback_data: "earn" }]);88Api.sendMessage({ text: txt, reply_markup: { inline_keyboard: kb } });89} catch (e) {90  Bot.sendMessage("خطا msn");91}