diff --git a/src/commands/eval.ts b/src/commands/eval.ts index ba00814..f5ea0cf 100644 --- a/src/commands/eval.ts +++ b/src/commands/eval.ts @@ -26,11 +26,11 @@ export default class Eval extends Command { if (args[0] && args[0].startsWith('-d')) { depth = Number(args[0].replace('-d', '')); if (!depth || depth < 0) depth = 0; - const index = evalMessage.findIndex((v) => v.startsWith('-d')); + const index = evalMessage.findIndex((v) => v.startsWith('-d')) + 1; evalString = evalMessage.slice(index).join(' ').trim(); } if (args[0] === '-a') { - const index = evalMessage.findIndex((v) => v === '-a'); + const index = evalMessage.findIndex((v) => v === '-a') + 1; message.channel.createMessage(`${index}`); evalString = `(async () => { ${evalMessage.slice(index).join(' ').trim()} })()`; }