gpt-4o-mini-2024-07-18· OpenAI
WildChat-4.8M (AI2)
Organize este código: if ((boardnow.turn == "X" ? boardnow.X : boardnow.O) !=…
- User
Organize este código:
if ((boardnow.turn == "X" ? boardnow.X : boardnow.O) != sender.replace("@s.whatsapp.net", "")) return; const moving = validmove(Number(budy), `${from}`); const matrix = moving._matrix; if (moving.isWin) { if (moving.winner == "SERI") { const chatEqual = `*🎮 Jogo da Velha 🕹️*Jogo terminou empatado 😐
; reply(chatEqual); DLT_FL(./armor/tictactoe/db/${from}.json`); joguinhodavelhajs.splice([]); fs.writeFileSync('./datab/usuarios/joguinhodavelha.json', JSON.stringify(joguinhodavelhajs)); joguinhodavelhajs2.splice([]); fs.writeFileSync('./datab/usuarios/joguinhodavelha2.json', JSON.stringify(joguinhodavelhajs2)); return; }const winnerJID = moving.winner == "O" ? moving.O : moving.X; const looseJID = moving.winner == "O" ? moving.X : moving.O; const chatWon = `*🎮 Jogo da Velha 🕹️*Vencido por @${winnerJID} 😎👑 `;
client.sendMessage(from, { text: chatWon }, { quoted: selo, mentions: [moving.winner == "O" ? moving.O + "@s.whatsapp.net" : moving.X + "@s.whatsapp.net"] }); setTimeout(() => { if (fs.existsSync(`./armor/tictactoe/db/${from}.json`)) { DLT_FL(`./armor/tictactoe/db/${from}.json`); reply(`*🕹️ Jogo da velha resetado... 🕹️*`); } else { console.log(colors.red(time, "red"), colors.magenta("[ EXPIRADO ]"), colors.red('Jogo da velha expirado')); } joguinhodavelhajs.splice([]); fs.writeFileSync('./datab/usuarios/joguinhodavelha.json', JSON.stringify(joguinhodavelhajs)); joguinhodavelhajs2.splice([]); fs.writeFileSync('./datab/usuarios/joguinhodavelha2.json', JSON.stringify(joguinhodavelhajs2)); }, 300000); // 5 minutos reply(`_*🥳 Parabéns @${winnerJID}, você ganhou 20 Golds por ter vencido o Jogo da Velha! 🎉_*`); DLT_FL(`./armor/tictactoe/db/${from}.json`); - Assistant