From b88100617938a14147c20e574308f1c7c67fdf4a Mon Sep 17 00:00:00 2001 From: fredthedoggy <45927799+fredthedoggy@users.noreply.github.com> Date: Tue, 8 Sep 2020 10:55:36 -0400 Subject: [PATCH] Add Restart Command Add a Restart Command for Process Manager 2 --- commands/restart.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 commands/restart.js diff --git a/commands/restart.js b/commands/restart.js new file mode 100644 index 0000000..28032f0 --- /dev/null +++ b/commands/restart.js @@ -0,0 +1,13 @@ +module.exports = { + name: "restart", + description: "Shuts down the bot. If running under PM2, bot will restart automatically.", + permission: 'ADMINISTRATOR', + args: true, + async (message, args, client) => { + await message.reply("Bot is restarting"); + await Promise.all(client.commands.map(cmd => + client.unloadCommand(cmd) + )); + process.exit(0); +}; +}; \ No newline at end of file