diff --git a/jarvis/cogs/dev.py b/jarvis/cogs/dev.py index c4c41b3..b900bd6 100644 --- a/jarvis/cogs/dev.py +++ b/jarvis/cogs/dev.py @@ -238,16 +238,17 @@ 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") + @commands.is_owner() async def _eval(self, ctx, *, code: str): try: output = eval(code, locals(), globals()) except Exception: output = traceback.format_exc() if inspect.isawaitable(output): - output = await output - await ctx.send(f"```{output}```") + await ctx.send(f"```{await output}```") + else: + await ctx.send(f"```{output}```") def setup(bot):