diff --git a/commands/games/box-choosing.js b/commands/games/box-choosing.js index 49f37e86..9a5a2e19 100644 --- a/commands/games/box-choosing.js +++ b/commands/games/box-choosing.js @@ -14,7 +14,8 @@ module.exports = class BoxChoosingCommand extends Command { }); this.playing = new Set(); - this.played = new Set(); + this.blue = new Set(); + this.red = new Set(); } async run(msg) { @@ -43,8 +44,15 @@ module.exports = class BoxChoosingCommand extends Command { }); if (!choose.size) break; path = ''; - if (this.played.has(msg.author.id)) path += 'both'; - path += line.paths[line.options.indexOf(choose.first().content.toLowerCase())]; + if (this.red.has(msg.author.id) && this.blue.has(msg.author.id)) { + path += 'both'; + this.red.delete(msg.author.id); + this.blue.delete(msg.author.id); + } else { + const choice = line.paths[line.options.indexOf(choose.first().content.toLowerCase())]; + path += choice; + this[choice].add(msg.author.id); + } i = 0; } else { const verification = await verify(msg.channel, msg.author, 120000); @@ -53,8 +61,6 @@ module.exports = class BoxChoosingCommand extends Command { } } this.playing.delete(msg.channel.id); - if (this.played.has(msg.author.id)) this.played.delete(msg.author.id); - else this.played.add(msg.author.id); return msg.say('See you soon!'); } catch (err) { this.playing.delete(msg.channel.id); diff --git a/package.json b/package.json index 587772c2..d1255bdc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "85.10.2", + "version": "85.10.3", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {