diff --git a/jarvis/cogs/dev.py b/jarvis/cogs/dev.py index b900bd6..9ab06be 100644 --- a/jarvis/cogs/dev.py +++ b/jarvis/cogs/dev.py @@ -241,14 +241,12 @@ class DevCog(commands.Cog): @commands.command(name="eval") @commands.is_owner() async def _eval(self, ctx, *, code: str): + code = f"async def fn():{code}" try: - output = eval(code, locals(), globals()) + output = exec(code, globals(), locals()) except Exception: output = traceback.format_exc() - if inspect.isawaitable(output): - await ctx.send(f"```{await output}```") - else: - await ctx.send(f"```{output}```") + await ctx.send(f"```{output}```") def setup(bot):