aboutsummaryrefslogtreecommitdiff
path: root/cogs/utils.py
diff options
context:
space:
mode:
authorMango0x45 <thomasvoss@live.com>2020-08-18 20:40:28 +0000
committerMango0x45 <thomasvoss@live.com>2020-08-18 20:40:28 +0000
commit2690371183f70ab6b6912a29aa47589a202caac5 (patch)
tree3950461e20bf50056d465a9a42fdc183035c3ce2 /cogs/utils.py
parent490420649fe8a0d5c729493a09bb1b91b92eebdd (diff)
downloadsteve-bot-2690371183f70ab6b6912a29aa47589a202caac5.tar
steve-bot-2690371183f70ab6b6912a29aa47589a202caac5.tar.gz
steve-bot-2690371183f70ab6b6912a29aa47589a202caac5.tar.bz2
steve-bot-2690371183f70ab6b6912a29aa47589a202caac5.tar.lz
steve-bot-2690371183f70ab6b6912a29aa47589a202caac5.tar.xz
steve-bot-2690371183f70ab6b6912a29aa47589a202caac5.tar.zst
steve-bot-2690371183f70ab6b6912a29aa47589a202caac5.zip
Added math()
Diffstat (limited to 'cogs/utils.py')
-rwxr-xr-xcogs/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cogs/utils.py b/cogs/utils.py
index ec1e09b..ae5a84b 100755
--- a/cogs/utils.py
+++ b/cogs/utils.py
@@ -382,6 +382,10 @@ class Utils(commands.Cog):
output = ", ".join([*commands])
await ctx.send(f"```List of custom commands:\n{output}```")
+ @commands.command(aliases=['eval', 'calc'])
+ async def math(self, ctx, *, equation: str = "2 + 2"):
+ """Evaluate a mathematical equation"""
+ await ctx.send(f'`{equation} = {eval(equation)}`')
def setup(bot):
bot.add_cog(Utils(bot))