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/utilities/wolframAlpha.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/utilities/wolframAlpha.ts')
-rw-r--r-- | src/commands/utilities/wolframAlpha.ts | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/commands/utilities/wolframAlpha.ts b/src/commands/utilities/wolframAlpha.ts index b682c85..baf764f 100644 --- a/src/commands/utilities/wolframAlpha.ts +++ b/src/commands/utilities/wolframAlpha.ts @@ -4,8 +4,6 @@ import { clientSendAndPermCheck, colors, emojis, - inspectCleanRedactCodeblock, - uploadImageToImgur, type ArgType, type CommandMessage, type SlashMessage @@ -57,12 +55,12 @@ export default class WolframAlphaCommand extends BushCommand { if (message.util.isSlashMessage(message)) await message.interaction.deferReply(); args.image && void message.util.reply({ content: `${emojis.loading} Loading...`, embeds: [] }); - const waApi = WolframAlphaAPI(client.config.credentials.wolframAlphaAppId); + const waApi = WolframAlphaAPI(this.client.config.credentials.wolframAlphaAppId); const decodedEmbed = new EmbedBuilder().addFields([ { name: '📥 Input', - value: await inspectCleanRedactCodeblock(args.expression) + value: await this.client.utils.inspectCleanRedactCodeblock(args.expression) } ]); const sendOptions: MessageOptions = { content: null, allowedMentions: AllowedMentions.none() }; @@ -73,16 +71,23 @@ export default class WolframAlphaCommand extends BushCommand { decodedEmbed.setTitle(`${emojis.successFull} Successfully Queried Expression`).setColor(colors.success); if (args.image) { - decodedEmbed.setImage(await uploadImageToImgur(calculated.split(',')[1])); + decodedEmbed.setImage(await this.client.utils.uploadImageToImgur(calculated.split(',')[1])); decodedEmbed.addFields([{ name: '📤 Output', value: '​' }]); } else { - decodedEmbed.addFields([{ name: '📤 Output', value: await inspectCleanRedactCodeblock(calculated.toString()) }]); + decodedEmbed.addFields([ + { name: '📤 Output', value: await this.client.utils.inspectCleanRedactCodeblock(calculated.toString()) } + ]); } } catch (error) { decodedEmbed .setTitle(`${emojis.errorFull} Unable to Query Expression`) .setColor(colors.error) - .addFields([{ name: `📤 Error`, value: await inspectCleanRedactCodeblock(`${error.name}: ${error.message}`, 'js') }]); + .addFields([ + { + name: `📤 Error`, + value: await this.client.utils.inspectCleanRedactCodeblock(`${error.name}: ${error.message}`, 'js') + } + ]); } sendOptions.embeds = [decodedEmbed]; |