diff --git a/commands/games-mp/connect-four.js b/commands/games-mp/connect-four.js index 9ab9d750..f65d0db3 100644 --- a/commands/games-mp/connect-four.js +++ b/commands/games-mp/connect-four.js @@ -62,7 +62,7 @@ module.exports = class ConnectFourCommand extends Command { this.client.games.delete(msg.channel.id); return msg.say('Looks like they declined...'); } - const available = Object.keys(colors).filter(clr => color != clr); + const available = Object.keys(colors).filter(clr => color !== clr); await msg.say(`${opponent}, what color do you want to be? Either ${list(available, 'or')}.`); const filter = res => res.author.id === opponent.id && available.includes(res.content.toLowerCase()); const p2Color = await msg.channel.awaitMessages(filter, { @@ -84,14 +84,14 @@ module.exports = class ConnectFourCommand extends Command { ${this.displayBoard(board, playerOneEmoji, playerTwoEmoji)} ${nums.join('')} `); - const filter = res => { + const pickFilter = res => { if (res.author.id !== user.id) return false; const choice = res.content; if (choice.toLowerCase() === 'end') return true; const i = Number.parseInt(choice, 10) - 1; return board[colLevels[i]] && board[colLevels[i]][i] !== undefined; }; - const turn = await msg.channel.awaitMessages(filter, { + const turn = await msg.channel.awaitMessages(pickFilter, { max: 1, time: 60000 });