aboutsummaryrefslogtreecommitdiff
path: root/src/commands/utilities/wolframAlpha.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/utilities/wolframAlpha.ts')
-rw-r--r--src/commands/utilities/wolframAlpha.ts18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/commands/utilities/wolframAlpha.ts b/src/commands/utilities/wolframAlpha.ts
index 95df5e8..0e1cb14 100644
--- a/src/commands/utilities/wolframAlpha.ts
+++ b/src/commands/utilities/wolframAlpha.ts
@@ -45,10 +45,12 @@ export default class WolframAlphaCommand extends BushCommand {
args.image && void message.util.reply({ content: `${util.emojis.loading} Loading...`, embeds: [] });
const waApi = WolframAlphaAPI(client.config.credentials.wolframAlphaAppId);
- const decodedEmbed = new EmbedBuilder().addFields({
- name: '📥 Input',
- value: await util.inspectCleanRedactCodeblock(args.expression)
- });
+ const decodedEmbed = new EmbedBuilder().addFields([
+ {
+ name: '📥 Input',
+ value: await util.inspectCleanRedactCodeblock(args.expression)
+ }
+ ]);
const sendOptions: MessageOptions = { content: null, allowedMentions: AllowedMentions.none() };
try {
const calculated = await (args.image
@@ -58,15 +60,17 @@ export default class WolframAlphaCommand extends BushCommand {
if (args.image) {
decodedEmbed.setImage(await util.uploadImageToImgur(calculated.split(',')[1]));
- decodedEmbed.addFields({ name: '📤 Output', value: '​' });
+ decodedEmbed.addFields([{ name: '📤 Output', value: '​' }]);
} else {
- decodedEmbed.addFields({ name: '📤 Output', value: await util.inspectCleanRedactCodeblock(calculated.toString()) });
+ decodedEmbed.addFields([{ name: '📤 Output', value: await util.inspectCleanRedactCodeblock(calculated.toString()) }]);
}
} catch (error) {
decodedEmbed
.setTitle(`${util.emojis.errorFull} Unable to Query Expression`)
.setColor(util.colors.error)
- .addFields({ name: `📤 Error`, value: await util.inspectCleanRedactCodeblock(`${error.name}: ${error.message}`, 'js') });
+ .addFields([
+ { name: `📤 Error`, value: await util.inspectCleanRedactCodeblock(`${error.name}: ${error.message}`, 'js') }
+ ]);
}
sendOptions.embeds = [decodedEmbed];