mahdiyar30301/ZorenixAI_botPublic · Bot Template

Not Bot Is Hacking You 🤣🤩

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

commands/zcok.js

javascript · 72 lines

Raw
1/**#command2name: zcok3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: zcok14answer: 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 ZU = 1000000;34var msgTxt = "";35try {36  if (typeof update !== "undefined" && update && update.callback_query && update.callback_query.message) {37    var cm = update.callback_query.message;38    if (cm.caption) msgTxt = String(cm.caption);39    else if (cm.text) msgTxt = String(cm.text);40  }41} catch (eT) {}42var oid = "";43var hx = msgTxt.indexOf("#");44if (hx >= 0) {45  oid = msgTxt.slice(hx + 1);46  var cut = oid.length;47  var i = 0;48  for (i = 0; i < oid.length; i++) {49    var ch = oid.charAt(i);50    if (ch < "0" || ch > "9") { cut = i; break; }51  }52  oid = oid.slice(0, cut);53}54if (!oid) oid = String((await db.global.get("zc_last")) || "");55if (!oid) { Bot.sendMessage("شماره شارژ نیست"); return; }56var raw = await db.global.get("zc_ord_" + oid);57if (!raw) { Bot.sendMessage("سفارش نیست"); return; }58var ord = null;59try { ord = JSON.parse(String(raw)); } catch (eJ) { ord = null; }60if (!ord || ord.status === "ok") { Bot.sendMessage("نامعتبر یا تکراری"); return; }61ord.status = "ok";62await db.global.set("zc_ord_" + oid, JSON.stringify(ord));63var buyer = String(ord.uid || "");64var amt = parseInt(ord.amt) || 0;65var cur = parseInt(await db.global.get("wal_" + buyer) || 0) || 0;66await db.global.set("wal_" + buyer, cur + amt);67await db.global.set("wal_gen_" + buyer, "4");68Bot.sendMessage("✅ شارژ #" + oid + " — +" + (amt / ZU) + " ZC");69try { Api.sendMessage({ chat_id: buyer, text: "✅ شارژ تایید شد: +" + (amt / ZU) + " ZC\nهر ۱ ZC = ۱۰۰۰ هزار تومان" }); } catch (eS) {}70} catch (e) {71  Bot.sendMessage("خطا zcok");72}