diff options
| author | 2018-03-03 23:28:41 +0000 | |
|---|---|---|
| committer | 2018-03-03 23:28:41 +0000 | |
| commit | 1af4cf1bc3e76973e6961de5cb62a682a55a02da (patch) | |
| tree | d31f994d91f891342a05332c925557ea9a0d21de /bot/cogs/math.py | |
| parent | Add cog for turning math expressions into LaTeX (#18) (diff) | |
Add docstrings for math commands
Diffstat (limited to 'bot/cogs/math.py')
| -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 ("**", "__")): |