From e188c54b67046e0ae602befd13361da70cfa0f96 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Fri, 29 Nov 2024 10:41:48 +1100 Subject: [PATCH] Allow power operator to regex --- src/commands/calculator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/calculator.ts b/src/commands/calculator.ts index dcdb06f..e18bd19 100644 --- a/src/commands/calculator.ts +++ b/src/commands/calculator.ts @@ -7,7 +7,7 @@ import * as math from 'mathjs';// I hate this, but it doesn't provide a default export default class Calculator { static run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){ const now = Date.now(); - const exp = interaction.options.getString('expression', true).replace(/[^-()\d/*+.]/g, ''); + const exp = interaction.options.getString('expression', true).replace(/[^-()\d/*+.^]/g, ''); try { let result:math.EvalFunction; switch (exp) {