From d3ff82862022b3f447511c537e7128a0f362c84c Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Thu, 27 Jan 2022 13:30:02 -0700 Subject: [PATCH] big brain --- commands/dev/restart.js | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/commands/dev/restart.js b/commands/dev/restart.js index 5a76cfb..8d3c4d3 100644 --- a/commands/dev/restart.js +++ b/commands/dev/restart.js @@ -12,24 +12,23 @@ module.exports = { }, help: "Fully restarts the bot. Developer-only.", async execute(message, msg, args, cmd, prefix, mention, client) { - if (!client.developers.includes(message.author.id)) { - try { - await require('../../util/lxp/cacheloop')(client); - await require('../../util/vcloop')(client); - await require('../../util/monitorloop')(client); - await message.channel.send("Cache synchronized with DB! Restarting..."); - return cp.exec("pm2 restart natsuki", function(error, stdout, stderr) { - if (error) { - return message.channel.send({embeds: [new Discord.MessageEmbed() - .setTitle("Error") - .setDescription(`\`\`\`${error}\`\`\``) - .setColor("ff446a") - .setFooter({text: "Natsuki", iconURL: client.user.avatarURL()}) - .setTimestamp()]} - ); - } - }); - } catch {return message.channel.send("There was an error in trying to do that!");} - } + if (!client.developers.includes(message.author.id)) {return message.channel.send("You must be a developer in order to do that!");} + try { + await require('../../util/lxp/cacheloop')(client); + await require('../../util/vcloop')(client); + await require('../../util/monitorloop')(client); + await message.channel.send("Cache synchronized with DB! Restarting..."); + return cp.exec("pm2 restart natsuki", function(error, stdout, stderr) { + if (error) { + return message.channel.send({embeds: [new Discord.MessageEmbed() + .setTitle("Error") + .setDescription(`\`\`\`${error}\`\`\``) + .setColor("ff446a") + .setFooter({text: "Natsuki", iconURL: client.user.avatarURL()}) + .setTimestamp()]} + ); + } + }); + } catch {return message.channel.send("There was an error in trying to do that!");} } }; \ No newline at end of file