From 22b3a8af49dc16bf5d8f9c3ce48b4770505ea33b Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Wed, 6 Jul 2022 20:28:04 +0200 Subject: remove array from add*(...) --- src/commands/utilities/calculator.ts | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/commands/utilities/calculator.ts') 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() }); } -- cgit