mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix lint
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user