| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- import TicTacToe from '../lib/tictactoe.js'
- let timeout = 60000
- let poin = 600
- let poin_lose = -100
- let poin_bot = 200
- global.suit = global.suit ? global.suit : {}
- //import MessageType from '@adiwajshing/baileys'
- let MessageType = (await import(global.baileys)).default
- let handler = async (m, { conn, text, command, usedPrefix, args }) => {
- 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]" }
- try {
- if (command == 'ppt' || command == 'pvp' || command == 'suit' || command == 'suitpvp') {
- const time = global.db.data.users[m.sender].wait + 30000;
- if (new Date() - global.db.data.users[m.sender].wait < 30000) return conn.fakeReply(m.chat, `*๐ ๐๐๐ฎ, ๐๐จ๐ฅ๐๐ง๐ ${msToTime(time - new Date())} ๐๐ฃ๐ฉ๐๐จ ๐๐ ๐ช๐จ๐๐ง ๐ค๐ฉ๐ง๐ค๐จ ๐๐ค๐ข๐๐ฃ๐๐ค*`, m.sender, `แดบแต สฐแตแตแตโฟ หขแตแตแต`, 'status@broadcast', null, fake);
- const guideText = `๐๐ข๐๐๐ซ๐ ๐ฟ, ๐๐๐ฉ๐๐ฅ ๐ ๐จ ๐๐ข๐ฃ๐๐ซ๐ โ๏ธ\n\n๐พ ๐
๐ช๐๐๐ง ๐๐ค๐ฃ ๐๐ก ๐๐ค๐ฉ:\nโข ${usedPrefix + command} piedra\nโข ${usedPrefix + command} papel\nโข ${usedPrefix + command} tijera\n\n๐น ๐
๐ช๐๐๐ง ๐๐ค๐ฃ ๐ช๐ฃ ๐ช๐จ๐ช๐๐ง๐๐ค:\n${usedPrefix + command} @usuario`;
- if (!m.mentionedJid[0] && !args[0]) return conn.sendButton(m.chat, guideText, wm, pp, [['Piedra ๐ฟ', `${usedPrefix + command} piedra`], ['Papel ๐', `${usedPrefix + command} papel`], ['Tijera โ๏ธ', `${usedPrefix + command} tijera`]], m);
- const user = global.db.data.users[m.sender];
- const playerChoice = args[0]?.toLowerCase();
- const choices = ['piedra', 'papel', 'tijera'];
- const botChoice = choices[Math.floor(Math.random() * 3)];
- const name = conn.getName(m.sender);
- if (!m.mentionedJid[0] && choices.includes(playerChoice)) {
- global.db.data.users[m.sender].wait = new Date() * 1;
-
- const rules = { piedra: { beats: 'tijera', win: 1000, lose: 300, winType: 'coins', loseType: 'coins' },
- papel: { beats: 'piedra', win: 1000, lose: 300, winType: 'coins', loseType: 'xp' },
- tijera: { beats: 'papel', win: 1000, lose: 300, winType: 'coins', loseType: 'coins' }};
- let result, message;
- if (playerChoice === botChoice) {
- user.exp += 500;
- result = '๐๐๐๐ผ๐๐ ๐ค';
- message = '๐ Premios : 500 XP';
- } else if (rules[playerChoice].beats === botChoice) {
- user[rules[playerChoice].winType] += rules[playerChoice].win;
- result = '๐๐ผ ๐๐ผ๐๐ผ๐ฟ๐! ๐';
- message = `๐ Premios : ${rules[playerChoice].win} ${rules[playerChoice].winType}`;
- } else {
- user[rules[playerChoice].loseType] -= rules[playerChoice].lose;
- result = '๐๐ผ ๐๐๐๐ฟ๐๐ฟ๐! ๐คก';
- message = `โ Pรฉrdida: -${rules[playerChoice].lose} ${rules[playerChoice].loseType}`;
- }
- conn.reply(m.chat, `\`ใ ${result} ใ\`\n\n๐ Tu: ${playerChoice}\n๐ El Bot: ${botChoice}\n${message}`, m, { contextInfo: {externalAdReply: { title: name, body: wm, thumbnail: img.getRandom(), sourceUrl: redes.getRandom()}}});
- }
- if (m.mentionedJid[0]) {
- if (Object.values(conn.suit).find(room => room.id.startsWith('suit') && [room.p, room.p2].includes(m.sender))) return m.reply(`โ ๏ธ ๐๐๐ง๐ข๐๐ฃ๐ ๐ฉ๐ช ๐ฅ๐๐ง๐ฉ๐๐๐ ๐๐ฃ๐ฉ๐๐จ ๐๐ ๐๐ฃ๐๐๐๐ ๐ค๐ฉ๐ง๐`);
- if (Object.values(conn.suit).find(room => room.id.startsWith('suit') && [room.p, room.p2].includes(m.mentionedJid[0]))) return m.reply(`โ ๏ธ ๐๐ก ๐ช๐จ๐ช๐๐ง๐๐ค ๐ฎ๐ ๐๐จ๐ฉ๐ฬ ๐๐ช๐๐๐ฃ๐๐ค, ๐๐จ๐ฅ๐๐ง๐ ๐ ๐ฆ๐ช๐ ๐ฉ๐๐ง๐ข๐๐ฃ๐`);
- const id = 'suit_' + new Date() * 1;
- const caption = `๐ฎ๐พ ๐๐๐ - ๐๐๐๐ฟ๐๐ผ, ๐๐ผ๐๐๐ ๐ ๐๐๐
๐๐๐ผ ๐พ๐ฎ\n\n@${m.sender.split`@`[0]} ๐ฟ๐๐๐ผ๐๐๐ผ ๐ผ @${m.mentionedJid[0].split`@`[0]}\n\n> _*Escribe (aceptar) para aceptar*_\n> _*Escribe (rechazar) para rechazar*_`;
- conn.suit[id] = {
- chat: await conn.sendMessage(m.chat, { text: caption, mentions: [m.sender, m.mentionedJid[0]] }),
- id: id,
- p: m.sender,
- p2: m.mentionedJid[0],
- status: 'wait',
- waktu: setTimeout(() => {
- if (conn.suit[id]) conn.reply(m.chat, `โณ ๐๐๐๐๐๐ ๐ผ๐๐๐๐ผ๐ฟ๐, ๐๐ ๐๐๐ ๐๐ ๐พ๐ผ๐๐พ๐๐๐ผ`, m);
- delete conn.suit[id];
- }, timeout),
- poin: 1000,
- poin_lose: 300,
- poin_bot: 500,
- timeout
- }}
- }
- if (command == 'slot' || command == 'apostar' || command == 'slot1' || command == 'slot2' || command == 'slot3') {
- const slotTypes = {
- slot1: { currency: 'exp',
- name: 'Exp',
- emojis: ['๐', 'โก', '๐ช'],
- cooldown: 60000,
- bonusWin: apuesta => apuesta * 2,
- consolation: 50,
- symbol: 'โก'
- },
- slot2: { currency: 'money',
- name: 'KantuCoins',
- emojis: ['๐ช', '๐ฎ', '๐งฟ'],
- cooldown: 60000,
- bonusWin: apuesta => apuesta * 2,
- consolation: 30,
- symbol: '๐ช'
- },
- slot3: {
- currency: 'limit',
- name: 'Diamantes',
- emojis: ['๐ช', '๐ฃ', '๐'],
- cooldown: 30000,
- bonusWin: apuesta => apuesta * 2,
- consolation: 2,
- symbol: '๐'
- }}
- const fa = `${mg}๐๐จ๐๐ง ๐๐ ๐ก๐ ๐จ๐๐๐ช๐๐๐ฃ๐ฉ๐ ๐ข๐๐ฃ๐๐ง๐:\n\n๐๐๐๐ข๐ฅ๐ก๐ค:\n*โข ${usedPrefix}slot1 50* (aportas exp)\n*โข ${usedPrefix}slot2 50* (aportas KantuCoins)\n*โข ${usedPrefix}slot3 50* (aportas Diamantes)`.trim()
- const validateBet = (users, apuesta, currency, name) => {
- if (apuesta < 10) throw `โ ๏ธ ๐๐๐๐๐ฌ ๐๐ฉ๐จ๐ฌ๐ญ๐๐ซ ๐ฎ๐ง ๐ฆ๐ข๐ง๐ข๐ฆ๐จ ๐๐ *10 ${name}*`
- if (users[currency] < apuesta) throw `โ ๏ธ ๐๐จ ๐ญ๐ข๐๐ง๐๐ฌ ๐ฌ๐ฎ๐๐ข๐๐ข๐๐ง๐ญ๐๐ฌ *${name}* ๐ฉ๐๐ซ๐ ๐๐ฉ๐จ๐ฌ๐ญ๐r. ๐๐ง๐ญ๐๐ซ๐๐๐ญ๐ฎ๐ ๐๐จ๐ง ๐๐ฅ ๐๐จ๐ญ ๐ฉ๐๐ซ๐ ๐จ๐๐ญ๐๐ง๐๐ซ ๐ฆ๐ฬ๐ฌ ๐ซ๐๐๐ฎ๐ซ๐ฌ๐จ๐ฌ.`
- }
- const playSlot = async (m, conn, apuesta, config, users) => {
- const { currency, name, emojis, cooldown, bonusWin, consolation } = config
- const time = users.lastslot + cooldown
- if (new Date() - users.lastslot < cooldown) throw `*๐๐ฎ๐๐ฅ๐ฏ๐ ๐๐ง: ${msToTime(time - new Date())} ๐ฉ๐๐ซ๐ ๐๐จ๐ง๐ญ๐ข๐ง๐ฎ๐๐ซ ๐๐ฉ๐จ๐ฌ๐ญ๐๐ง๐๐จ ${name}* ๐ฐ`
- users.lastslot = Date.now()
- const a = Math.floor(Math.random() * emojis.length)
- const b = Math.floor(Math.random() * emojis.length)
- const c = Math.floor(Math.random() * emojis.length)
- const [x, y, z] = [[], [], []]
- for (let i = 0; i < 3; i++) {
- x[i] = emojis[(a + i) % emojis.length]
- y[i] = emojis[(b + i) % emojis.length]
- z[i] = emojis[(c + i) % emojis.length]
- }
- let end
- if (a === b && b === c) {
- end = `๐ฅณ *ยกQUร PRO! HAS GANADO +${bonusWin(apuesta)} ${name}*`
- users[currency] += apuesta
- } else if (a === b || a === c || b === c) {
- end = `๐ฏ *ยกCASI! VUELVE A INTENTAR*\n*BONO DE +${consolation} ${name}*`
- users[currency] += consolation
- } else {
- end = `๐ฟ *ยกHAS PERDIDO! โ -${apuesta} ${name}*`
- users[currency] -= apuesta
- }
- const hawemod = [
- `${x[0]} : ${y[1]} : ${z[0]}\n${z[1]} : ${y[0]} : ${x[0]}\n${z[2]} : ${x[1]} : ${y[2]}`,
- `${x[0]} : ${y[0]} : ${z[0]}\n${y[1]} : ${z[1]} : ${x[1]}\n${x[2]} : ${y[2]} : ${z[2]}`,
- `${x[0]} : ${y[1]} : ${z[0]}\n${y[1]} : ${z[2]} : ${x[1]}\n${x[2]} : ${y[1]} : ${z[2]}`
- ]
- const maxIterations = 25
- const arrayCasuale = generaArrayCasuale(hawemod, maxIterations)
- const array = [...arrayCasuale]
- const { key } = await conn.sendMessage(m.chat, { text: `๐น` }, { quoted: m })
- for (let i = 0; i < maxIterations; i++) {
- await conn.sendMessage(m.chat, {text: `๐ฐ | *RANURAS* | ๐ฐ\nโโโโโโโโ\n${array[i]}\nโโโโโโโโ\n๐ฐ | *SLOTS* | ๐ฐ`, edit: key }, { quoted: m })
- await new Promise(resolve => setTimeout(resolve, 50))
- }
- await conn.sendMessage(m.chat, { text: `๐ฐ | *RANURAS* | ๐ฐ\nโโโโโโโโ\n${x[0]} : ${y[0]} : ${z[0]}\n${x[1]} : ${y[1]} : ${z[1]}\n${x[2]} : ${y[2]} : ${z[2]}\nโโโโโโโโ\n๐ฐ | *SLOTS* | ๐ฐ\n\n${end}`, edit: key }, { quoted: m })
- }
- if (command === 'apostar' || command === 'slot') {
- if (!args[0]) return m.reply(fa)
- if (isNaN(args[0])) return m.reply(fa)
- const apuesta = parseInt(args[0])
-
- await conn.sendButton(m.chat, `*Elige en quรฉ apostar tus ${apuesta}*`, botname, null, [['โก Exp', `.slot1 ${apuesta}`], ['๐ช KantuCoins', `.slot2 ${apuesta}`], ['๐ Diamantes', `.slot3 ${apuesta}`]], null, null, m)
- return
- }
- if (!args[0]) return m.reply(fa)
- if (isNaN(args[0])) return m.reply(fa)
- const apuesta = parseInt(args[0])
- const users = global.db.data.users[m.sender]
- const slotType = slotTypes[command]
- if (!slotType) return
- try {
- validateBet(users, apuesta, slotType.currency, slotType.name)
- await playSlot(m, conn, apuesta, slotType, users)
- } catch (e) {
- m.reply(e)
- }}
- if (command == 'tictactoe' || command == 'ttc' || command == 'ttt' || command == 'xo') {
- conn.game = conn.game ? conn.game : {}
- if (Object.values(conn.game).find(room => room.id.startsWith('tictactoe') && [room.game.playerX, room.game.playerO].includes(m.sender))) return m.reply(`โ ๏ธ ๐๐ค๐๐๐ซ๐๐ ๐๐ก๐๐ช๐๐๐ฃ ๐๐จ๐ฉ๐ ๐๐ช๐๐๐ฃ๐๐ค ๐๐ฃ ๐ก๐ ๐จ๐๐ก๐ ๐จ๐ ๐ฆ๐ช๐๐๐ง๐ ๐๐๐๐ฃ๐๐ค๐ฃ๐๐ง ๐๐จ๐๐ง๐๐๐ *salir*\n๐๐๐ข๐๐๐๐ฃ ๐ฅ๐ช๐๐๐๐จ ๐๐ก๐๐ข๐๐ฃ๐๐ง ๐ก๐ ๐จ๐๐ก๐ ๐ช๐จ๐๐ฃ๐๐ค ๐๐ก ๐๐ค๐ข๐๐ฃ๐๐ค *${usedPrefix}delttt*`)
- if (!text) return m.reply(`*โ ๏ธ ๐ฟ๐๐๐ ๐๐ ๐๐๐ง๐๐๐ ๐ช๐ฃ ๐ฃ๐ค๐ข๐๐ง๐ ๐ ๐ก๐ ๐จ๐๐ก๐\n๐๐๐๐ข๐ฅ๐ก๐ค\n${usedPrefix + command} Sala bot*`)
- let room = Object.values(conn.game).find(room => room.state === 'WAITING' && (text ? room.name === text : true))
- if (room) {
- await conn.reply(m.chat, `โ ๏ธ ๐ผ๐ก๐๐ช๐๐๐ฃ ๐จ๐ ๐๐ ๐ช๐ฃ๐๐๐ค ๐ ๐ก๐ ๐จ๐๐ก๐ *${text}*\n๐๐ ๐ฅ๐ช๐๐๐๐ฃ ๐๐ช๐๐๐ง!! ๐ผ`, fkontak, m)
- await conn.reply(m.chat, `โญ๏ธ *Clรกsico Juego del Gato, 3 en raya o tateti* โ\n\n*ยฟCรณmo jugar?*\n_Responde al Juego con un Nรบmero, el mensaje debe contener la posiscion en la que quieras estar (1,2,3,4,5,6,7,8,9)_`, fkontak, m)
- room.o = m.chat
- room.game.playerO = m.sender
- room.state = 'PLAYING'
- let arr = room.game.render().map(v => {
- return {
- X: 'โ',
- O: 'โญ',
- 1: '1๏ธโฃ',
- 2: '2๏ธโฃ',
- 3: '3๏ธโฃ',
- 4: '4๏ธโฃ',
- 5: '5๏ธโฃ',
- 6: '6๏ธโฃ',
- 7: '7๏ธโฃ',
- 8: '8๏ธโฃ',
- 9: '9๏ธโฃ',
- }[v]})
- let str = `๐ ๐
๐ช๐๐๐ค ๐ฉ๐๐ฉ๐๐ฉ๐
- ๐ซ ๐
๐ช๐๐๐๐ค๐ง๐๐จ:
- *โโโโโโโโโ*
- โ = @${room.game.playerX.split('@')[0]}
- โญ = @${room.game.playerO.split('@')[0]}
- *โโโโโโโโโ*
- ${arr.slice(0, 3).join('')}
- ${arr.slice(3, 6).join('')}
- ${arr.slice(6).join('')}
- *โโโโโโโโโ*
- ๐๐ช๐ง๐ฃ๐ค ๐๐:
- @${room.game.currentTurn.split('@')[0]}
- `.trim()
- if (room.x !== room.o) await conn.sendMessage(room.x, { text: str, mentions: this.parseMention(str)}, { quoted: fkontak, m })
- await conn.sendMessage(room.o, { text: str, mentions: conn.parseMention(str)}, { quoted: fkontak, m })
-
- } else {
- room = {
- id: 'tictactoe-' + (+new Date),
- x: m.chat,
- o: '',
- game: new TicTacToe(m.sender, 'o'),
- state: 'WAITING' }
-
- if (text) room.name = text
- let imgplay = `https://img.freepik.com/vector-premium/juego-tres-raya-icono-contorno-lineal-neon_7280-2422.jpg`
- conn.sendMessage(m.chat, { image: { url: imgplay }, caption: `๐ผ ๐
๐ช๐๐๐ค๐จ ๐๐๐ฉ๐๐ฉ๐
- ๐ ๐๐จ๐ฅ๐๐ง๐๐ฃ๐๐ค ๐๐ก ๐จ๐๐๐ช๐ฃ๐๐ค ๐๐ช๐๐๐๐ค๐ง ๐ฅ๐ช๐๐๐ ๐๐ฃ๐๐ง๐๐จ๐ ๐ช๐จ๐๐ฃ๐๐ค ๐๐ก ๐๐ค๐ข๐๐ฃ๐๐ค
- *${usedPrefix + command} ${text}*
- ๐๐ ๐ฆ๐ช๐๐๐ง๐๐จ ๐๐๐๐ฃ๐๐ค๐ฃ๐๐ง ๐ก๐ ๐จ๐๐ก๐ ๐ช๐จ๐ ๐๐ก ๐๐ค๐ข๐๐ฃ๐๐ค
- *${usedPrefix}delttt*` }, { mentions: conn.parseMention(text), quoted: fkontak })
- conn.game[room.id] = room
- }}
- if (command == 'math' || command == 'mates' || command == 'matemรกticas') {
- // 60000 = 1 minuto // 30000 = 30 segundos // 15000 = 15 segundos // 10000 = 10 segundos
- let time = global.db.data.users[m.sender].wait + 60000
- if (new Date - global.db.data.users[m.sender].wait < 60000) return await conn.reply(m.chat, `*๐ ๐๐๐๐๐๐ผ ${Math.floor((time - new Date()) / 1000)} ๐๐๐๐๐๐ฟ๐๐ ๐ผ๐๐๐๐ ๐ฟ๐ ๐๐๐๐๐๐ ๐ผ ๐
๐๐๐ผ๐*`, fkontak, m)
- let mat = `${lenguajeGB['smsAvisoIIG']()}โจ ๐๐ช๐๐๐ ๐๐จ๐๐ง๐๐๐ ๐ก๐ ๐๐๐๐๐๐ช๐ก๐ฉ๐๐
- *Nivel del dificultad*
- ${Object.keys(modes).join(' | ')}
- *Ejemplo:*
- ${usedPrefix + command} noob
- ${usedPrefix + command} impossible2
- ๐ผ *Mientras mas dificultad mayor recompensa*`.trim()
- if (args.length < 1) return await conn.reply(m.chat, mat, fkontak, m)
- let mode = args[0].toLowerCase()
- if (!(mode in modes)) return await conn.reply(m.chat, mat, fkontak, m)
- let id = m.chat
- if (id in global.math) return conn.reply(m.chat, `โ ๏ธ *แดแดแด
แดแด ษชแด สแดส แดสแดษขแดษดแดแด sษชษด สแดsแดแดษดแด
แดส แดส แดsแดแด แดสแดแด!!*`, global.math[id][0])
- //let ii = global.db.data.users[m.sender].limit += 10 math.dia
- let math = genMath(mode)
- global.math[id] = [
- await conn.reply(m.chat, `โญโใ *${wm}* ใโโฑ
- โ๐พ๐ช๐๐ก ๐๐จ ๐ง๐๐จ๐ช๐ก๐ฉ๐๐๐ค ๐๐: *${math.str} = ?*
- โโโโโโโโโโโโโโโโโโ
- โ๐งญ ๐๐๐๐ข๐ฅ๐ค: *${(math.time / 1000).toFixed(0)} segundos*
- โโโโโโโโโโโโโโโโโโ
- โ๐๐๐จ๐ฅ๐ค๐ฃ๐๐ ๐ ๐๐จ๐ฉ๐ ๐ข๐๐ฃ๐จ๐๐๐ ๐ฎ ๐๐๐ฃ๐
- โ๐ *${math.bonus}: XP*
- โฐโโโโฐ ๐ ${vs} โฑโโโโแ`, m),
- math, 4,
-
- //await conn.reply(m.chat, `โฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธโฌ๏ธ๐๐๐๐๐๐๐ฟ๐ผ ๐ผ๐ ๐๐๐๐๐ผ๐
๐ ๐ฟ๐ ๐ผ๐๐๐๐ฝ๐ผ ๐พ๐๐ ๐๐ผ ๐๐๐๐๐๐๐๐๐ผ\n\n๐ผ๐๐๐๐๐ ๐๐๐ ๐๐๐๐๐ผ๐๐ ๐ผ๐ฝ๐๐๐ ๐๐ ๐๐๐๐ ๐๐๐๐ ๐ผ๐๐๐๐๐\n\n${wm}`, fkontak, m), math, 4,
- setTimeout(() => {
- if (global.math[id]) conn.reply(m.chat, `โ sแด แดแดแดสแด แดส แดษชแดแดแดแด สแด สแดsแดแดแดsแดแด แดs *${math.result}*`, global.math[id][0])
- delete global.math[id]
- }, math.time)
- ]
- global.db.data.users[m.sender].wait = new Date * 1
- }
- if (command == 'delttt' || command == 'deltt' || command == 'delxo' || command == 'deltictactoe') {
- let room = Object.values(conn.game).find(room => room.id.startsWith('tictactoe') && [room.game.playerX, room.game.playerO].includes(m.sender))
- if (room == undefined) return await conn.reply(m.chat, `โ ๏ธ ๐๐ ๐๐๐๐ผ๐ ๐๐ ๐๐๐๐๐๐๐ผ ๐๐ผ๐๐๐๐ฟ๐ผ ๐๐ ๐๐ ๐
๐๐๐๐ ๐๐๐๐ ๐๐ ๐๐ผ๐๐ผ\n\n๐ซ ๐๐๐๐พ๐๐ผ๐ ๐๐ผ๐๐๐๐ฟ๐ผ (${usedPrefix}ttt sala nueva)`, fkontak, m)
- delete conn.game[room.id]
- await conn.reply(m.chat, `โ ๏ธ ๐๐ผ ๐๐ผ๐๐ผ ๐๐๐๐ ๐๐ ๐๐ผ๐๐ผ ๐๐๐ ๐๐๐๐๐๐๐ผ๐ฟ๐ผ`, fkontak, m)
- }} catch (e) {
- //await conn.reply(m.chat, `${lenguajeGB['smsMalError3']()}#report ${lenguajeGB['smsMensError2']()} ${usedPrefix + command}\n\n${wm}`, fkontak, m)
- console.log(e)}}
- handler.help = ["ppt", "suitpvp", "pvp", "slot", "apostar", "tictactoe", "ttt", "math", "matemรกticas", "delttt"];
- handler.tags = ['game'];
- handler.command = /^(ppt|suitpvp|suit|pvp|moneda|suert|currency|luck|cara|Method|slot|apostar|slot1|slot2|slot3|tictactoe|ttc|ttt|xo|math|mates|matemรกticas|delttt|deltt|delxo|deltictactoe)$/i
- handler.group = true
- handler.game = true
- handler.register = true
- export default handler
- function pickRandom(list) {
- return list[Math.floor(Math.random() * list.length)]}
- function msToTime(duration) {
- var milliseconds = parseInt((duration % 1000) / 100),
- seconds = Math.floor((duration / 1000) % 60),
- minutes = Math.floor((duration / (1000 * 60)) % 60),
- hours = Math.floor((duration / (1000 * 60 * 60)) % 24)
- hours = (hours < 10) ? "0" + hours : hours
- minutes = (minutes < 10) ? "0" + minutes : minutes
- seconds = (seconds < 10) ? "0" + seconds : seconds
- return minutes + " m " + seconds + " s "
- }
- let modes = {
- noob: [-3, 3,-3, 3, '+-', 15000, 30],
- easy: [-10, 10, -10, 10, '*/+-', 20000, 50],
- medium: [-40, 40, -20, 20, '*/+-', 30000, 200],
- hard: [-100, 100, -70, 70, '*/+-', 40000, 500],
- extreme: [-999999, 999999, -999999, 999999, '*/', 40000, 2500],
- impossible: [-99999999999, 99999999999, -99999999999, 999999999999, '*/', 50000, 5500],
- impossible2: [-999999999999999, 999999999999999, -999, 999, '/', 60000, 8500]
- }
- let operators = {
- '+': '+',
- '-': '-',
- '*': 'ร',
- '/': 'รท'
- }
- // XP
- function genMath(mode) {
- let [a1, a2, b1, b2, ops, time, bonus] = modes[mode]
- let a = randomInt(a1, a2)
- let b = randomInt(b1, b2)
- let op = pickRandom([...ops])
- let result = (new Function(`return ${a} ${op.replace('/', '*')} ${b < 0 ? `(${b})` : b}`))()
- if (op == '/') [a, result] = [result, a]
- return {
- str: `${a} ${operators[op]} ${b}`,
- mode,
- time,
- bonus,
- result
- }}
- function generaArrayCasuale(array, ripetizioni) {
- let risultato = [];
- for (let i = 0; i < ripetizioni; i++) {
- risultato = risultato.concat(array);
- }
- return risultato;
- }
- function randomInt(from, to) {
- if (from > to) [from, to] = [to, from]
- from = Math.floor(from)
- to = Math.floor(to)
- return Math.floor((to - from) * Math.random() + from)
- }
|