diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-17 20:03:05 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-06-17 20:03:05 -0400 |
commit | e1c613829950a534d9f45c00a033b83575be3b3c (patch) | |
tree | 2de1e5231217211ae4087c46cc74dc46c584507a /src/commands/dev/javascript.ts | |
parent | 0e87bbd3940d89defcb04926587b35c8f4d1947f (diff) | |
download | tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.tar.gz tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.tar.bz2 tanzanite-e1c613829950a534d9f45c00a033b83575be3b3c.zip |
remove global client variable
Diffstat (limited to 'src/commands/dev/javascript.ts')
-rw-r--r-- | src/commands/dev/javascript.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/commands/dev/javascript.ts b/src/commands/dev/javascript.ts index 7c47f2f..e472a5a 100644 --- a/src/commands/dev/javascript.ts +++ b/src/commands/dev/javascript.ts @@ -3,7 +3,6 @@ import { clientSendAndPermCheck, colors, emojis, - inspectCleanRedactCodeblock, type ArgType, type CommandMessage, type OptArgType, @@ -60,13 +59,13 @@ export default class JavascriptCommand extends BushCommand { } const code = args.code.replace(/[“”]/g, '"').replace(/```*(?:js)?/g, ''); const embed = new EmbedBuilder(); - const input = await inspectCleanRedactCodeblock(code, 'js'); + const input = await this.client.utils.inspectCleanRedactCodeblock(code, 'js'); try { const rawOutput = /^(9\s*?\+\s*?10)|(10\s*?\+\s*?9)$/.test(code) ? '21' : new VM({ eval: true, wasm: true, timeout: 1_000, fixAsync: true }).run(`${code}`); - const output = await inspectCleanRedactCodeblock(rawOutput, 'js', { + const output = await this.client.utils.inspectCleanRedactCodeblock(rawOutput, 'js', { depth: args.sel_depth ?? 0, getters: true, inspectStrings: true, @@ -82,7 +81,7 @@ export default class JavascriptCommand extends BushCommand { embed.setTitle(`${emojis.errorFull} Unable to Evaluate Expression`).setColor(colors.error); embed.addFields([ { name: '📥 Input', value: input }, - { name: '📤 Error', value: await inspectCleanRedactCodeblock(e, 'js', { colors: false }) } + { name: '📤 Error', value: await this.client.utils.inspectCleanRedactCodeblock(e, 'js', { colors: false }) } ]); } |