Don't allow blue vs purple in c4

This commit is contained in:
Dragon Fire
2021-01-09 12:09:28 -05:00
parent 54391c3996
commit 19b98a6030
+5 -1
View File
@@ -83,7 +83,11 @@ 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 => {
if (color === 'blue' && clr === 'purple') return false;
if (color === 'purple' && clr === 'blue') return false;
return 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, {