Updated reload

This commit is contained in:
2023-03-29 15:07:48 +02:00
parent 0961ca773b
commit 8012be779d

View File

@@ -60,17 +60,14 @@ module.exports = {
const { exec } = require('child_process');
// exec a command and check if it has an error
const pm2 = exec('pm2 restart 0', )
exec('pm2 restart 0', (error, stdout, stderr) => {
if (pm2.stderr) {
await interaction.editReply("An error occurred while reloading the bot.")
return
}
if (error) {
interaction.editReply({ content: 'There was an error while reloading the bot.', ephemeral: true });
} else{
interaction.editReply({ content: 'Bot reloaded.', ephemeral: true });
}
});
await interaction.editReply("Bot reloaded.")
}