let handler = m => m handler.before = async function (m) { let pp = 'https://telegra.ph/file/c7924bf0e0d839290cc51.jpg' let fkontak = { "key": { "participants":"0@s.whatsapp.net", "remoteJid": "status@broadcast", "fromMe": false, "id": "Halo" }, "message": { "contactMessage": { "vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` }}, "participant": "0@s.whatsapp.net" } this.suit = this.suit ? this.suit : {} if (db.data.users[m.sender].suit < 0) db.data.users[m.sender].suit = 0 let room = Object.values(this.suit).find(room => room.id && room.status && [room.p, room.p2].includes(m.sender)) if (room) { let win = '' let tie = false if (m.sender == room.p2 && /^(acc(ept)?|Aceptar|acerta|aceptar|gas|aceptare?|nao|Rechazar|rechazar|ga(k.)?bisa)/i.test(m.text) && m.isGroup && room.status == 'wait') { if (/^(tolak|gamau|rechazar|ga(k.)?bisa)/i.test(m.text)) { let textno = `โš ๏ธ@${room.p2.split`@`[0]} ๐™๐™€๐˜พ๐™ƒ๐˜ผ๐™•๐™Š ๐™€๐™‡ ๐™‹๐™‘๐™‹, ๐™€๐™‡ ๐™…๐™๐™€๐™‚๐™Š ๐™Ž๐™€ ๐˜พ๐˜ผ๐™‰๐˜พ๐™€๐™‡๐˜ผ` m.reply(textno, null, {mentions: this.parseMention(textno)}) delete this.suit[room.id] return !0 } room.status = 'play' room.asal = m.chat clearTimeout(room.waktu) let textplay = `๐ŸŽฎ ๐™€๐™‡ ๐™…๐™๐™€๐™‚๐™Š๐™Ž ๐˜พ๐™Š๐™ˆ๐™„๐™€๐™‰๐™•๐˜ผ, ๐™‡๐˜ผ๐™Ž ๐™Š๐™‹๐˜พ๐™„๐™Š๐™‰๐™€๐™Ž ๐™ƒ๐˜ผ๐™‰ ๐™Ž๐™„๐˜ฟ๐™Š ๐™€๐™‰๐™‘๐™„๐˜ผ๐˜ฟ๐™Š๐™Ž ๐˜ผ ๐™‡๐™Š๐™Ž ๐˜พ๐™ƒ๐˜ผ๐™ ๐™‹๐™๐™„๐™‘๐˜ผ๐˜ฟ๐™Š ๐˜ฟ๐™€ @${room.p.split`@`[0]} ๐™” @${room.p2.split`@`[0]}\n\n๐™Ž๐™€๐™‡๐™€๐˜พ๐˜พ๐™„๐™Š๐™‰๐™€๐™‰ ๐™๐™‰๐˜ผ ๐™Š๐™‹๐˜พ๐™„๐™Š๐™‰ ๐™€๐™‰ ๐™Ž๐™๐™Ž ๐˜พ๐™ƒ๐˜ผ๐™๐™Ž ๐™‹๐™๐™„๐™‘๐˜ผ๐˜ฟ๐™Š ๐™๐™€๐™Ž๐™‹๐™€๐˜พ๐™๐™„๐™‘๐˜ผ๐™ˆ๐™€๐™‰๐™๐™€\n\n> *Elegir opciรณn en wa.me/${conn.user.jid.split`@`[0]}*` m.reply(textplay, m.chat, {mentions: this.parseMention(textplay)}) let comienzop = `โš ๏ธ ๐™‹๐™Š๐™ ๐™๐˜ผ๐™‘๐™Š๐™ ๐™Ž๐™€๐™‡๐™€๐˜พ๐˜พ๐™„๐™Š๐™‰๐™€ ๐™๐™‰๐˜ผ ๐˜ฟ๐™€ ๐™‡๐˜ผ๐™Ž ๐™Ž๐™„๐™‚๐™๐™„๐™€๐™‰๐™๐™€๐™Ž ๐™Š๐™‹๐˜พ๐™„๐™Š๐™‰๐™€๐™Ž\n\n> แƒฆ Piedra\n> แƒ“ Papel\n> แƒฆ Tijera\n\n> *Responda al mensaje con la opciรณn*` let comienzop2 = `โš ๏ธ ๐™‹๐™Š๐™ ๐™๐˜ผ๐™‘๐™Š๐™ ๐™Ž๐™€๐™‡๐™€๐˜พ๐˜พ๐™„๐™Š๐™‰๐™€ ๐™๐™‰๐˜ผ ๐˜ฟ๐™€ ๐™‡๐˜ผ๐™Ž ๐™Ž๐™„๐™‚๐™๐™„๐™€๐™‰๐™๐™€๐™Ž ๐™Š๐™‹๐˜พ๐™„๐™Š๐™‰๐™€๐™Ž\n\n> แƒฆ Piedra\n> แƒฆ Papel\n> แƒฆ Tijera\n\n> *Responda al mensaje con la opciรณn*` if (!room.pilih) this.sendMessage(room.p, { text: comienzop }, { quoted: fkontak }) if (!room.pilih2) this.sendMessage(room.p2, { text: comienzop2 }, { quoted: fkontak }) room.waktu_milih = setTimeout(() => { let iniciativa = `โš ๏ธ ๐™‰๐™„๐™‰๐™‚๐™๐™‰ ๐™…๐™๐™‚๐˜ผ๐˜ฟ๐™Š๐™ ๐™๐™Š๐™ˆ๐™Š ๐™‡๐˜ผ ๐™„๐™‰๐™„๐˜พ๐™„๐˜ผ๐™๐™„๐™‘๐˜ผ ๐˜ฟ๐™€ ๐™€๐™ˆ๐™‹๐™€๐™•๐˜ผ๐™ ๐™€๐™‡ ๐™…๐™๐™€๐™‚๐™Š๐™Ž, ๐™€๐™‡ ๐™‹๐™‘๐™‹ ๐™Ž๐™€ ๐˜ผ๐™ƒ ๐˜พ๐˜ผ๐™‰๐˜พ๐™€๐™‡๐˜ผ๐˜ฟ๐™Š` if (!room.pilih && !room.pilih2) this.sendMessage(m.chat, { text: iniciativa }, { quoted: fkontak }) else if (!room.pilih || !room.pilih2) { win = !room.pilih ? room.p2 : room.p let textnull = `โš ๏ธ @${(room.pilih ? room.p2 : room.p).split`@`[0]} ๐™‰๐™Š ๐™€๐™‡๐™€๐™‚๐™„๐™Ž๐™๐™€ ๐™‰๐™„๐™‰๐™‚๐™๐™‰๐˜ผ ๐™Š๐™‹๐˜พ๐™„๐™Š๐™‰, ๐™๐™„๐™‰ ๐˜ฟ๐™€๐™‡ ๐™‹๐™‘๐™‹` this.sendMessage(m.chat, { text: textnull }, { quoted: fkontak }, { mentions: this.parseMention(textnull) }) db.data.users[win == room.p ? room.p : room.p2].exp += room.poin db.data.users[win == room.p ? room.p : room.p2].exp += room.poin_bot db.data.users[win == room.p ? room.p2 : room.p].exp -= room.poin_lose } delete this.suit[room.id] return !0 }, room.timeout)} let jwb = m.sender == room.p let jwb2 = m.sender == room.p2 let g = /tijera/i let b = /piedra/i let k = /papel/i let reg = /^(tijera|piedra|papel)/i if (jwb && reg.test(m.text) && !room.pilih && !m.isGroup) { room.pilih = reg.exec(m.text.toLowerCase())[0] room.text = m.text m.reply(`โœ… ๐™ƒ๐˜ผ๐™Ž ๐™€๐™‡๐™€๐™‚๐™„๐˜ฟ๐™Š ${m.text}, ๐™๐™€๐™‚๐™๐™€๐™Ž๐˜ผ ๐˜ผ๐™‡ ๐™‚๐™๐™๐™‹๐™Š ๐™” ${room.pilih2 ? `*๐™๐™€๐™‘๐™„๐™Ž๐˜ผ ๐™‡๐™Š๐™Ž ๐™๐™€๐™Ž๐™๐™‡๐™๐˜ผ๐˜ฟ๐™Š๐™Ž*` : '*๐™€๐™Ž๐™‹๐™€๐™๐˜ผ ๐™‡๐™Š๐™Ž ๐™๐™€๐™Ž๐™๐™‡๐™๐˜ผ๐˜ฟ๐™Š๐™Ž*'}`) if (!room.pilih2) this.reply(room.p2, `${lenguajeGB['smsAvisoIIG']()}๐™€๐™‡ ๐™Š๐™‹๐™Š๐™‰๐™€๐™‰๐™๐™€ ๐˜ผ๐™ƒ ๐™€๐™‡๐™€๐™‚๐™„๐˜ฟ๐™Š, ๐™€๐™Ž ๐™๐™ ๐™๐™๐™๐™‰๐™Š ๐˜ฟ๐™€ ๐™€๐™‡๐™€๐™‚๐™„๐™`, fkontak, 0)} if (jwb2 && reg.test(m.text) && !room.pilih2 && !m.isGroup) { room.pilih2 = reg.exec(m.text.toLowerCase())[0] room.text2 = m.text m.reply(`โœ… ๐™ƒ๐˜ผ๐™Ž ๐™€๐™‡๐™€๐™‚๐™„๐˜ฟ๐™Š ${m.text}, ๐™๐™€๐™‚๐™๐™€๐™Ž๐˜ผ ๐˜ผ๐™‡ ๐™‚๐™๐™๐™‹๐™Š ๐™” ${room.pilih ? `*๐™๐™€๐™‘๐™„๐™Ž๐˜ผ ๐™‡๐™Š๐™Ž ๐™๐™€๐™Ž๐™๐™‡๐™๐˜ผ๐˜ฟ๐™Š๐™Ž*` : '*๐™€๐™Ž๐™‹๐™€๐™๐˜ผ ๐™‡๐™Š๐™Ž ๐™๐™€๐™Ž๐™๐™‡๐™๐˜ผ๐˜ฟ๐™Š๐™Ž*'}`) if (!room.pilih) this.reply(room.p, `${lenguajeGB['smsAvisoIIG']()}๐™€๐™‡ ๐™Š๐™‹๐™Š๐™‰๐™€๐™‰๐™๐™€ ๐˜ผ๐™ƒ ๐™€๐™‡๐™€๐™‚๐™„๐˜ฟ๐™Š, ๐™€๐™Ž ๐™๐™ ๐™๐™๐™๐™‰๐™Š ๐˜ฟ๐™€ ๐™€๐™‡๐™€๐™‚๐™„๐™`, fkontak, 0)} let stage = room.pilih let stage2 = room.pilih2 if (room.pilih && room.pilih2) { clearTimeout(room.waktu_milih) if (b.test(stage) && g.test(stage2)) win = room.p else if (b.test(stage) && k.test(stage2)) win = room.p2 else if (g.test(stage) && k.test(stage2)) win = room.p else if (g.test(stage) && b.test(stage2)) win = room.p2 else if (k.test(stage) && b.test(stage2)) win = room.p else if (k.test(stage) && g.test(stage2)) win = room.p2 else if (stage == stage2) tie = true this.reply(room.asal, `๐Ÿฅณ ๐™๐™€๐™Ž๐™๐™‡๐™๐˜ผ๐˜ฟ๐™Š๐™Ž ๐˜ฟ๐™€๐™‡ ๐™‹๐™‘๐™‹\n\n${tie ? '๐Ÿฅด ๐™€๐™ˆ๐™‹๐˜ผ๐™๐™€!!' : ''} *@${room.p.split`@`[0]} (${room.text})* ${tie ? '' : room.p == win ? ` *๐™‚๐˜ผ๐™‰๐˜ผ๐™๐™๐™€ ๐Ÿฅณ ${room.poin} XP*` : ` *๐™‹๐™€๐™๐˜ฟ๐™„๐™Šฬ ๐Ÿคก ${room.poin_lose} XP*`} *@${room.p2.split`@`[0]} (${room.text2})* ${tie ? '' : room.p2 == win ? `*๐™‚๐˜ผ๐™‰๐˜ผ๐™๐™๐™€ ๐Ÿฅณ ${room.poin} XP*` : ` *๐™‹๐™€๐™๐˜ฟ๐™„๐™Šฬ ๐Ÿคก ${room.poin_lose} XP*`} `.trim(), m, { mentions: [room.p, room.p2] } ) if (!tie) { db.data.users[win == room.p ? room.p : room.p2].exp += room.poin db.data.users[win == room.p ? room.p : room.p2].exp += room.poin_bot db.data.users[win == room.p ? room.p2 : room.p].exp += room.poin_lose } delete this.suit[room.id]}} return !0 } handler.exp = 0 export default handler function random(arr) { return arr[Math.floor(Math.random() * arr.length)]}