diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-07-06 20:28:04 +0200 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-07-06 20:28:04 +0200 |
commit | 22b3a8af49dc16bf5d8f9c3ce48b4770505ea33b (patch) | |
tree | ab7f68cb9168d2b06ba144b48311370059cf5fac /src/commands/utilities/calculator.ts | |
parent | 544f94704c9dd37913de11eab67cd594d17fcd87 (diff) | |
download | tanzanite-22b3a8af49dc16bf5d8f9c3ce48b4770505ea33b.tar.gz tanzanite-22b3a8af49dc16bf5d8f9c3ce48b4770505ea33b.tar.bz2 tanzanite-22b3a8af49dc16bf5d8f9c3ce48b4770505ea33b.zip |
remove array from add*(...)
Diffstat (limited to 'src/commands/utilities/calculator.ts')
-rw-r--r-- | src/commands/utilities/calculator.ts | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/commands/utilities/calculator.ts b/src/commands/utilities/calculator.ts index 2204fe6..f0db916 100644 --- a/src/commands/utilities/calculator.ts +++ b/src/commands/utilities/calculator.ts @@ -39,30 +39,27 @@ export default class CalculatorCommand extends BushCommand { } public override async exec(message: CommandMessage | SlashMessage, args: { expression: string }) { - const decodedEmbed = new EmbedBuilder().addFields([ - { - name: '📥 Input', - value: await this.client.utils.inspectCleanRedactCodeblock(args.expression, 'mma') - } - ]); + const decodedEmbed = new EmbedBuilder().addFields({ + name: '📥 Input', + value: await this.client.utils.inspectCleanRedactCodeblock(args.expression, 'mma') + }); try { const calculated = /^(9\s*?\+\s*?10)|(10\s*?\+\s*?9)$/.test(args.expression) ? '21' : evaluate(args.expression); decodedEmbed .setTitle(`${emojis.successFull} Successfully Calculated Expression`) .setColor(colors.success) - .addFields([ - { name: '📤 Output', value: await this.client.utils.inspectCleanRedactCodeblock(calculated.toString(), 'mma') } - ]); + .addFields({ + name: '📤 Output', + value: await this.client.utils.inspectCleanRedactCodeblock(calculated.toString(), 'mma') + }); } catch (error) { decodedEmbed .setTitle(`${emojis.errorFull} Unable to Calculate Expression`) .setColor(colors.error) - .addFields([ - { - name: `📤 Error`, - value: await this.client.utils.inspectCleanRedactCodeblock(`${error.name}: ${error.message}`, 'js') - } - ]); + .addFields({ + name: `📤 Error`, + value: await this.client.utils.inspectCleanRedactCodeblock(`${error.name}: ${error.message}`, 'js') + }); } return await message.util.reply({ embeds: [decodedEmbed], allowedMentions: AllowedMentions.none() }); } |