added default message

This commit is contained in:
loicbersier 2019-12-17 20:28:37 +01:00
parent dc1b3af0b7
commit f914b7a44a

View file

@ -25,9 +25,11 @@ class execCommand extends Command {
async exec(message, args) { async exec(message, args) {
async function update() { 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}`); 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(`stdout: \n\`\`\`${stdout}\`\`\``, { split: true });
message.channel.send(`stderr: \n\`\`\`${stderr}\`\`\``, { split: true }); message.channel.send(`stderr: \n\`\`\`${stderr}\`\`\``, { split: true });
} }