455 commands2 envUpdated 7h agoCreated Aug 26, 2026
commands/petby.js
javascript · 41 lines
1/**#command2name: petby3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/**#command13name: petby14answer: 15keyboard: 16parse_mode: 17aliases: 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;31 32var ZU = 1000000;33if (String((await db.global.get("pet_" + uid)) || "")) { Bot.sendMessage("پت داری."); return; }34var w = parseInt(await db.global.get("wal_" + uid) || 0) || 0;35if (w < 50 * ZU) { Bot.sendMessage("۵۰ ZC لازم است."); return; }36await db.global.set("wal_" + uid, w - 50 * ZU);37await db.global.set("await_plus_" + uid, "1");38await db.global.set("plus_mode_" + uid, "petnm");39Bot.sendMessage("۵۰ ZC کم شد.\nاسم پت را بفرست.");40 41} catch (e) { Bot.sendMessage("خطا petby"); }