aboutsummaryrefslogtreecommitdiffstats
path: root/bot/cogs/math.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-03-03 23:28:41 +0000
committerGravatar Gareth Coles <[email protected]>2018-03-03 23:28:41 +0000
commit1af4cf1bc3e76973e6961de5cb62a682a55a02da (patch)
treed31f994d91f891342a05332c925557ea9a0d21de /bot/cogs/math.py
parentAdd 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.py10
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 ("**", "__")):