455 commands2 envUpdated 6h agoCreated Aug 26, 2026
commands/msnno.js
javascript · 68 lines
1/**#command2name: msnno3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: msnno14answer: 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}30var isBoss = (uid === "5861439682");31var isAdmin = isBoss || ((await db.global.get("rank_" + uid)) === "admin");32if (!isAdmin) { Bot.sendMessage("فقط ادمین"); return; }33var msgTxt = "";34try {35 if (typeof update !== "undefined" && update && update.callback_query && update.callback_query.message) {36 var cm = update.callback_query.message;37 if (cm.caption) msgTxt = String(cm.caption);38 else if (cm.text) msgTxt = String(cm.text);39 }40} catch (eT) {}41var oid = "";42var hx = msgTxt.indexOf("#");43if (hx >= 0) {44 oid = msgTxt.slice(hx + 1);45 var cut = oid.length;46 var i = 0;47 for (i = 0; i < oid.length; i++) {48 var ch = oid.charAt(i);49 if (ch < "0" || ch > "9") { cut = i; break; }50 }51 oid = oid.slice(0, cut);52}53if (!oid) oid = String((await db.global.get("msn_last")) || "");54if (!oid) { Bot.sendMessage("شماره نیست"); return; }55var raw = await db.global.get("msn_ord_" + oid);56if (raw) {57 var ord = null;58 try { ord = JSON.parse(String(raw)); } catch (eJ) { ord = null; }59 if (ord) {60 ord.status = "no";61 await db.global.set("msn_ord_" + oid, JSON.stringify(ord));62 try { Api.sendMessage({ chat_id: String(ord.uid), text: "❌ اسکرین مأموریت رد شد." }); } catch (eS) {}63 }64}65Bot.sendMessage("رد شد #" + oid);66} catch (e) {67 Bot.sendMessage("خطا msnno");68}