From 9f5d9da2a37ecfec412b149ec7dc385ab7b6a98c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 24 May 2022 18:29:57 -0400 Subject: fix: breaking changes --- src/commands/utilities/calculator.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/commands/utilities/calculator.ts') diff --git a/src/commands/utilities/calculator.ts b/src/commands/utilities/calculator.ts index 1a9d352..e17ef76 100644 --- a/src/commands/utilities/calculator.ts +++ b/src/commands/utilities/calculator.ts @@ -31,21 +31,25 @@ export default class CalculatorCommand extends BushCommand { } public override async exec(message: BushMessage | BushSlashMessage, args: { expression: string }) { - const decodedEmbed = new EmbedBuilder().addFields({ - name: '📥 Input', - value: await util.inspectCleanRedactCodeblock(args.expression, 'mma') - }); + const decodedEmbed = new EmbedBuilder().addFields([ + { + name: '📥 Input', + value: await util.inspectCleanRedactCodeblock(args.expression, 'mma') + } + ]); try { const calculated = /^(9\s*?\+\s*?10)|(10\s*?\+\s*?9)$/.test(args.expression) ? '21' : evaluate(args.expression); decodedEmbed .setTitle(`${util.emojis.successFull} Successfully Calculated Expression`) .setColor(util.colors.success) - .addFields({ name: '📤 Output', value: await util.inspectCleanRedactCodeblock(calculated.toString(), 'mma') }); + .addFields([{ name: '📤 Output', value: await util.inspectCleanRedactCodeblock(calculated.toString(), 'mma') }]); } catch (error) { decodedEmbed .setTitle(`${util.emojis.errorFull} Unable to Calculate 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') } + ]); } return await message.util.reply({ embeds: [decodedEmbed], allowedMentions: AllowedMentions.none() }); } -- cgit