mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 05:51:35 +02:00
It should work like this
This commit is contained in:
@@ -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
@@ -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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user