Updated reload
This commit is contained in:
@@ -60,17 +60,14 @@ module.exports = {
|
|||||||
|
|
||||||
const { exec } = require('child_process');
|
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) {
|
await interaction.editReply("Bot reloaded.")
|
||||||
interaction.editReply({ content: 'There was an error while reloading the bot.', ephemeral: true });
|
|
||||||
} else{
|
|
||||||
interaction.editReply({ content: 'Bot reloaded.', ephemeral: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user