| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- let handler = m => m
- handler.before = async function (m) {
- let pp = 'https://telegra.ph/file/c7924bf0e0d839290cc51.jpg'
- let fkontak = { "key": { "participants":"[email protected]", "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": "[email protected]" }
- 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)]}
|