diff --git a/src/commands/eval.ts b/src/commands/eval.ts index f0748dd..06fb02c 100644 --- a/src/commands/eval.ts +++ b/src/commands/eval.ts @@ -31,7 +31,7 @@ export default class Eval extends Command { } if (args[0] === '-a' || args[0] === '-async') { args.shift(); - evalString = `(async () => { ${args.join(' ').trim()} })()`; + evalString = `const top = this; (async () => { ${args.join(' ').trim()} })()`; } try { diff --git a/src/commands/parseall.ts b/src/commands/parseall.ts index b2a1cf0..ad8867e 100644 --- a/src/commands/parseall.ts +++ b/src/commands/parseall.ts @@ -25,13 +25,12 @@ export default class Parseall extends Command { embed.setFooter(`Requested by ${message.member.username}#${message.member.discriminator}`, message.member.avatarURL); embed.setTimestamp(); const search = await this.client.db.Account.find(); - const accounts = search; const final: string[] = []; - accounts.forEach(async (a) => { + for (const a of search) { try { const certFile = readdirSync(`${a.homepath}/Validation`)[0]; - const { notAfter } = await parseCertificate(this.client, `${a.homepath}/Validation/${certFile}`); + const { notAfter } = await parseCertificate(this.client, `${a.homepath}/Validation/${certFile}`); // eslint-disable-line // @ts-ignore const timeObject: {years: number, months: number, days: number, hours: number, minutes: number, seconds: number, firstDateWasLater: boolean} = moment.preciseDiff(new Date(), notAfter, true); const precise: [number, string][] = []; @@ -51,7 +50,7 @@ export default class Parseall extends Command { if (error.message.includes('panic: Certificate PEM Encode == nil')) final.push(`${this.client.stores.emojis.error} ** ${a.username}** Invalid certificate`); else throw error; } - }); + } if (final.join('\n').length < 2048) embed.setDescription(final.join('\n')); else {