From 83ef6a39a83c62c75fc774fc3ccb26b6a0e6ce22 Mon Sep 17 00:00:00 2001 From: thedragonsinn <98635854+thedragonsinn@users.noreply.github.com> Date: Sat, 4 Nov 2023 14:57:32 +0530 Subject: [PATCH] new syntax highlighting. --- app/plugins/dev/exec.py | 2 +- app/plugins/dev/shell.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/plugins/dev/exec.py b/app/plugins/dev/exec.py index e49e886..040f877 100644 --- a/app/plugins/dev/exec.py +++ b/app/plugins/dev/exec.py @@ -41,7 +41,7 @@ async def executor(bot: bot, message: Message) -> Message | None: if "-s" in message.flags: output = f">> `{output}`" else: - output = f"> `{code}`\n\n>> `{output}`" + output = f"```python\n> {code}```\n\n>> `{output}`" await reply.edit( output, name="exec.txt", diff --git a/app/plugins/dev/shell.py b/app/plugins/dev/shell.py index 0221cca..c19066b 100644 --- a/app/plugins/dev/shell.py +++ b/app/plugins/dev/shell.py @@ -16,7 +16,7 @@ async def run_cmd(bot: bot, message: Message) -> Message | None: ) except asyncio.exceptions.CancelledError: return await reply.edit("`Cancelled...`") - output: str = f"~$`{cmd}`\n\n`{proc_stdout}`" + output: str = f"
~${cmd}\n\n{proc_stdout}
" return await reply.edit(output, name="sh.txt", disable_web_page_preview=True) @@ -32,7 +32,7 @@ async def live_shell(bot: bot, message: Message) -> Message | None: if output != stdout: if len(stdout) <= 4096: await reply.edit( - f"`{stdout}`", + f"```shell\n{stdout}```", disable_web_page_preview=True, parse_mode=ParseMode.MARKDOWN, ) @@ -42,7 +42,7 @@ async def live_shell(bot: bot, message: Message) -> Message | None: await asyncio.Task(asyncio.sleep(sleep_for), name=reply.task_id) sleep_for += 1 return await reply.edit( - f"~$`{cmd}\n\n``{sub_process.full_std}`", + f"
~${cmd}\n\n{sub_process.full_std}
", name="shell.txt", disable_web_page_preview=True, )