Fixed exec failure

merge-requests/1/merge
Bsian 2019-10-29 20:16:08 +00:00
parent f0385ce177
commit e7437d4b59
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 6 additions and 1 deletions

View File

@ -18,7 +18,12 @@ export default class Exec extends Command {
if (!args.length) return this.client.commands.get('help').run(message, [this.name]);
const response = await message.channel.createMessage(`${this.client.stores.emojis.loading} ***Executing \`${args.join(' ')}\`***`);
const result = await this.client.util.exec(args.join(' '));
let result: string;
try {
result = await this.client.util.exec(args.join(' '));
} catch (error) {
result = error.message;
}
if (result.length <= 1975) return response.edit(`\`\`\`bash\n${result}\n\`\`\``);
const splitResult = this.client.util.splitString(result, 1975);