From 2690371183f70ab6b6912a29aa47589a202caac5 Mon Sep 17 00:00:00 2001 From: Mango0x45 Date: Tue, 18 Aug 2020 22:40:28 +0200 Subject: Added math() --- cogs/utils.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cogs/utils.py') 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)) -- cgit v1.2.3