Add await to eval
This commit is contained in:
parent
c74581d380
commit
9afab6ae4b
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@ import ulid
|
||||||
import base64
|
import base64
|
||||||
import subprocess
|
import subprocess
|
||||||
import traceback
|
import traceback
|
||||||
|
import inspect
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from jarvis.utils import build_embed, convert_bytesize
|
from jarvis.utils import build_embed, convert_bytesize
|
||||||
from jarvis.utils.field import Field
|
from jarvis.utils.field import Field
|
||||||
|
@ -244,6 +245,8 @@ class DevCog(commands.Cog):
|
||||||
output = eval(code, locals(), globals())
|
output = eval(code, locals(), globals())
|
||||||
except Exception:
|
except Exception:
|
||||||
output = traceback.format_exc()
|
output = traceback.format_exc()
|
||||||
|
if inspect.isawaitable(output):
|
||||||
|
output = await output
|
||||||
await ctx.send(f"```{output}```")
|
await ctx.send(f"```{output}```")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue