Update dev.py

This commit is contained in:
yasirarism 2022-12-21 07:37:34 +07:00 committed by GitHub
parent eabf19d866
commit ea2c267eaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,7 @@ async def evaluation_cmd_t(_, m):
cmd = m.text.split(" ", maxsplit=1)[1]
except IndexError:
return await status_message.edit("__No evaluate message!__")
p = print
old_stderr = sys.stderr
old_stdout = sys.stdout
redirected_output = sys.stdout = io.StringIO()
@ -127,6 +127,7 @@ async def evaluation_cmd_t(_, m):
async def aexec(code, client, message):
p = print
exec(
"async def __aexec(client, message): "
+ "".join(f"\n {l_}" for l_ in code.split("\n"))