forked from Supositware/Haha-Yes
added default message
This commit is contained in:
parent
dc1b3af0b7
commit
f914b7a44a
1 changed files with 3 additions and 1 deletions
|
@ -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 });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue