Add option to wait for games to finish

This commit is contained in:
Dragon Fire
2021-01-11 20:50:31 -05:00
parent 03950ac600
commit 524d31715a
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command');
const { verify } = require('../../util/Util');
const { verify, delay } = require('../../util/Util');
const texts = require('../../assets/json/shutdown');
module.exports = class ShutdownCommand extends Command {
@@ -39,9 +39,12 @@ module.exports = class ShutdownCommand extends Command {
currentString += `${calls} phone call${calls > 1 ? 's' : ''}`;
if (calls === 1 && (games > 0 ? games === 1 : true)) areIs = 'is';
}
await msg.reply(`There ${areIs} currently **${currentString}**. Are you sure?`);
await msg.reply(`There ${areIs} currently **${currentString}**. Wait for them to finish?`);
const verification = await verify(msg.channel, msg.author);
if (!verification) return msg.say('Aborted restart.');
if (verification) {
await msg.reply('Waiting...');
while (games > 0 || calls > 0) delay(5000);
}
}
try {
this.uses++;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "124.5.6",
"version": "124.5.7",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {