Don't need to block blue and purple anymore

This commit is contained in:
Dragon Fire
2021-01-23 11:09:48 -05:00
parent 9242c7b629
commit c3ca0455eb
+1 -5
View File
@@ -66,11 +66,7 @@ module.exports = class ConnectFourCommand extends Command {
const playerOneEmoji = color;
let playerTwoEmoji = color === colors.yellow ? colors.red : colors.yellow;
try {
const available = Object.keys(colors).filter(clr => {
if (color === colors.blue && clr === colors.purple) return false;
if (color === colors.purple && clr === colors.blue) return false;
return color !== clr;
});
const available = Object.keys(colors).filter(clr => color !== clr);
if (opponent.bot) {
playerTwoEmoji = colors[available[Math.floor(Math.random() * available.length)]];
} else {