From f914b7a44a45d396fbb9e44d903a282462d91ba2 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 17 Dec 2019 20:28:37 +0100 Subject: [PATCH] added default message --- commands/owner/exec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/owner/exec.js b/commands/owner/exec.js index c483d760..e9f3f1c5 100644 --- a/commands/owner/exec.js +++ b/commands/owner/exec.js @@ -25,9 +25,11 @@ class execCommand extends Command { async exec(message, args) { async function update() { - const { stdout, stderr } = await exec(args.exec).catch(err => { + let { stdout, stderr } = await exec(args.exec).catch(err => { return message.channel.send(`Oh no, an error has occured\n${err}`); }); + if (!stdout) stdout = 'Nothing'; + if (!stderr) stderr = 'No error'; message.channel.send(`stdout: \n\`\`\`${stdout}\`\`\``, { split: true }); message.channel.send(`stderr: \n\`\`\`${stderr}\`\`\``, { split: true }); }