From 8cad4a87dbad909e9a3c7a3b766261145c7b94a6 Mon Sep 17 00:00:00 2001 From: Bsian Date: Fri, 3 Jan 2020 20:09:21 +0000 Subject: [PATCH] Fix args --- src/commands/eval.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/eval.ts b/src/commands/eval.ts index a757ce3..dce0b14 100644 --- a/src/commands/eval.ts +++ b/src/commands/eval.ts @@ -19,7 +19,7 @@ export default class Eval extends Command { public async run(message: Message, args: string[]) { try { // const evalMessage = message.content.slice(this.client.config.prefix.length).split(' ').slice(1).join(' '); - let evalString = args.join(' ').trim(); + let evalString: string; let evaled: any; let depth = 0; @@ -27,10 +27,11 @@ export default class Eval extends Command { depth = Number(args[0].replace('-d', '')); if (!depth || depth < 0) depth = 0; args.shift(); + evalString = args.join(' ').trim(); } if (args[0] === '-a' || args[0] === '-async') { args.shift(); - evalString = `(async () => { ${evalString} })()`; + evalString = `(async () => { ${args.join(' ').trim()} })()`; } try {