From 6312fa243e345a872da0d07a5dd1e17734a46faf Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 27 Oct 2019 21:23:56 -0400 Subject: [PATCH] get config from client, also remove weird evalMessage thing --- src/commands/eval.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/commands/eval.ts b/src/commands/eval.ts index 44efeab..23a40cc 100644 --- a/src/commands/eval.ts +++ b/src/commands/eval.ts @@ -2,7 +2,7 @@ import { Message } from 'eris'; import { inspect } from 'util'; import axios from 'axios'; -import { Client, config } from '..'; +import { Client } from '..'; import { Command } from '../class'; export default class Eval extends Command { @@ -17,21 +17,21 @@ export default class Eval extends Command { public async run(message: Message) { try { - const evalMessage = message.content.slice(config.prefix.length).split(' ').slice(1).join(' '); + // const evalMessage = message.content.slice(this.client.config.prefix.length).split(' ').slice(1).join(' '); let evaled: any; let output: string; try { - evaled = await eval(evalMessage); + evaled = await eval(message.content); if (typeof evaled !== 'string') output = output && inspect(evaled, { depth: 1 }); } catch (error) { output = error.stack; } if (output) { - output = output.replace(RegExp(config.prefix, 'gi'), 'juul'); - output = output.replace(RegExp(config.emailPass, 'gi'), 'juul'); - output = output.replace(RegExp(config.cloudflare, 'gi'), 'juul'); + output = output.replace(RegExp(this.client.config.prefix, 'gi'), 'juul'); + output = output.replace(RegExp(this.client.config.emailPass, 'gi'), 'juul'); + output = output.replace(RegExp(this.client.config.cloudflare, 'gi'), 'juul'); } const display = this.client.util.splitString(output, 1975);