From 4ec596ae4025960dccff36b41239fa1d3f11cdfe Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Sun, 27 Jun 2021 19:11:54 -0600 Subject: [PATCH] Add eval command --- jarvis/cogs/dev.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jarvis/cogs/dev.py b/jarvis/cogs/dev.py index a6c4687..f791349 100644 --- a/jarvis/cogs/dev.py +++ b/jarvis/cogs/dev.py @@ -236,6 +236,12 @@ class DevCog(commands.Cog): output = subprocess.check_output(["cloc", "."]).decode("UTF-8") await ctx.send(f"```\n{output}\n```") + @commands.is_owner() + @commands.command(name=eval) + async def _eval(self, ctx, *, code: str): + output = eval(code, locals=locals(), globals=globals()) + await ctx.send(f"```{output}```") + def setup(bot): bot.add_cog(DevCog(bot))