diff options
| -rw-r--r-- | bot/cogs/math.py | 10 | 
1 files changed, 10 insertions, 0 deletions
diff --git a/bot/cogs/math.py b/bot/cogs/math.py index 94024e8ae..3a8b7c222 100644 --- a/bot/cogs/math.py +++ b/bot/cogs/math.py @@ -24,6 +24,10 @@ class Math:      @command()      async def latexify(self, ctx, *, expr: str): +        """ +        Return the LaTex output for a mathematical expression +        """ +          fixed_expr = expr.replace('^', '**').strip('`').replace("__", "")          try:              parsed = parse_expr(fixed_expr, evaluate=False) @@ -55,6 +59,12 @@ class Math:      @command()      async def calc(self, ctx, *, expr: str): +        """ +        Return the LaTex output for the solution to a mathematical expression + +        Note that exponentials are disabled to avoid abuse +        """ +          fixed_expr = expr.replace('^', '**').strip('`')          if any(x in fixed_expr for x in ("**", "__")):  |