455 commands2 envUpdated 7h agoCreated Aug 26, 2026
commands/npccgo.js
javascript · 62 lines
1/**#command2name: npccgo3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: npccgo14answer: 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 gift = await db.global.get("wal_gift_" + uid);32if (!gift) {33 await db.global.set("wal_gift_" + uid, "1");34 var c0 = parseInt(await db.global.get("wal_" + uid) || 0) || 0;35 await db.global.set("wal_" + uid, c0 + 10000);36}37var cost = 750;38var bal = parseInt(await db.global.get("wal_" + uid) || 0) || 0;39if (bal < cost) { Bot.sendMessage("موجودی کم است. کیف: " + bal); return; }40await db.global.set("wal_" + uid, bal - cost);41var you = Math.floor(Math.random() * 2);42var botn = Math.floor(Math.random() * 2);43var ys = you === 0 ? "شیر" : "خط";44var bs = botn === 0 ? "شیر" : "خط";45var neu = bal - cost;46var line = "تو: " + ys + "\nربات: " + bs + "\n";47if (you !== botn) {48 neu = neu + 1500;49 await db.global.set("wal_" + uid, neu);50 line = line + "برد! +۷۵۰";51} else {52 await db.global.set("wal_" + uid, neu);53 line = line + "باخت. −۷۵۰";54}55line = line + "\n💰 " + neu;56Api.sendMessage({57 text: line,58 reply_markup: { inline_keyboard: [[{ text: "🪙 دوباره", callback_data: "npccgo" }, { text: "🎮 بازیها", callback_data: "games" }]] }59});60} catch (e) {61 Bot.sendMessage("خطا npccgo");62}