merge-requests/4/head
Bsian 2020-06-15 22:50:34 +01:00
parent f5f04c5a0c
commit 06a0906ca9
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 4 additions and 4 deletions

View File

@ -27,16 +27,16 @@ export default class Eval extends Command {
depth = Number(args[0].replace('-d', '')); depth = Number(args[0].replace('-d', ''));
if (!depth || depth < 0) depth = 0; if (!depth || depth < 0) depth = 0;
const index = evalMessage.findIndex((v) => v.startsWith('-d')) + 1; const index = evalMessage.findIndex((v) => v.startsWith('-d')) + 1;
message.channel.createMessage(evalMessage.slice(index).join(' ').trim()); await message.channel.createMessage(evalMessage.slice(index).join(' ').trim());
evalString = evalMessage.slice(index).join(' ').trim(); evalString = evalMessage.slice(index).join(' ').trim();
} }
message.channel.createMessage(evalString); await message.channel.createMessage(evalString);
if (args[0] === '-a') { if (args[0] === '-a') {
const index = evalMessage.findIndex((v) => v === '-a') + 1; const index = evalMessage.findIndex((v) => v === '-a') + 1;
message.channel.createMessage(evalMessage.slice(index).join(' ').trim()); await message.channel.createMessage(evalMessage.slice(index).join(' ').trim());
evalString = `(async () => { ${evalMessage.slice(index).join(' ').trim()} })()`; evalString = `(async () => { ${evalMessage.slice(index).join(' ').trim()} })()`;
} }
message.channel.createMessage(evalString); await message.channel.createMessage(evalString);
try { try {
evaled = await eval(evalString); evaled = await eval(evalString);