diff --git a/interactionHandlers/commands/admin.js b/interactionHandlers/commands/admin.js index fd251ca..8fca5f7 100644 --- a/interactionHandlers/commands/admin.js +++ b/interactionHandlers/commands/admin.js @@ -6,7 +6,7 @@ const client = global.client const log = global.log -const exec = (command) => { +const runCommand = (command) => { return new Promise((resolve, reject) => { require('child_process').exec(command, (error, stdout, stderr) => { if (error) { @@ -29,17 +29,17 @@ module.exports.execute = async (interaction) => { switch (subcommand) { case 'silence': // Run `asterisk -x "channel request hangup all" - exec('asterisk -x "channel request hangup all"').then((res) => { + runCommand('asterisk -x "channel request hangup all"').then((res) => { interaction.reply({ content: ``, ephemeral: true }); }); break; case 'reload': // Run `fwconsole reload` - exec('fwconsole reload').then((res) => { + runCommand('fwconsole reload').then((res) => { interaction.reply({ content: res, ephemeral: true }); }); break; case 'reboot': // Run `reboot 0` - exec('reboot 0').then((res) => { + runCommand('reboot 0').then((res) => { interaction.reply({ content: "Rebooting...", ephemeral: true }); }); break;