It should work like this

This commit is contained in:
Dragon Fire
2018-08-03 18:30:23 -04:00
parent 91baed7e5f
commit 88a1b9109a
2 changed files with 12 additions and 6 deletions
+11 -5
View File
@@ -14,7 +14,8 @@ module.exports = class BoxChoosingCommand extends Command {
}); });
this.playing = new Set(); this.playing = new Set();
this.played = new Set(); this.blue = new Set();
this.red = new Set();
} }
async run(msg) { async run(msg) {
@@ -43,8 +44,15 @@ module.exports = class BoxChoosingCommand extends Command {
}); });
if (!choose.size) break; if (!choose.size) break;
path = ''; path = '';
if (this.played.has(msg.author.id)) path += 'both'; if (this.red.has(msg.author.id) && this.blue.has(msg.author.id)) {
path += line.paths[line.options.indexOf(choose.first().content.toLowerCase())]; 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; i = 0;
} else { } else {
const verification = await verify(msg.channel, msg.author, 120000); 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); 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!'); return msg.say('See you soon!');
} catch (err) { } catch (err) {
this.playing.delete(msg.channel.id); this.playing.delete(msg.channel.id);
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiao", "name": "xiao",
"version": "85.10.2", "version": "85.10.3",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Xiao.js", "main": "Xiao.js",
"scripts": { "scripts": {