From ce8ebfabfee2656e55f9ba8aac4ce2b75c250c57 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 28 Jun 2020 20:24:48 -0400 Subject: [PATCH] Check for games and phone calls before restart --- commands/util/shutdown.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/commands/util/shutdown.js b/commands/util/shutdown.js index 7e8e424e..066ea31a 100644 --- a/commands/util/shutdown.js +++ b/commands/util/shutdown.js @@ -1,4 +1,5 @@ const Command = require('../../structures/Command'); +const { verify } = await require('../../util/Util'); const texts = require('../../assets/json/shutdown'); module.exports = class ShutdownCommand extends Command { @@ -24,6 +25,16 @@ module.exports = class ShutdownCommand extends Command { } async run(msg, { code }) { + if (this.client.games.size > 0) { + await msg.reply(`There are currently **${this.client.games.size}** games going on. Are you sure?`); + const verification = await verify(msg.channel, msg.author); + if (!verification) return msg.say('Aborted restart.'); + } + if (this.client.phone.size > 0) { + await msg.reply(`There are currently **${this.client.phone.size}** phone calls going on. Are you sure?`); + const verification = await verify(msg.channel, msg.author); + if (!verification) return msg.say('Aborted restart.'); + } try { this.uses++; this.client.exportCommandLeaderboard();