Fix sh command

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2022-08-15 01:25:12 +03:00
parent c5779a40c9
commit 2dd258d0b0
Signed by untrusted user who does not match committer: ari
GPG key ID: A50D5B4B599AF8A2

View file

@ -318,6 +318,11 @@ Executed query `{uncode(sql_query)}`
Usage: sh <command...>"""
sh_command: str = command_to_str(command)
if not sh_command.strip():
await self._send_message(m("No command specified", message))
return
await self._send_message(
m(
f"""
@ -325,7 +330,7 @@ Command: `{uncode(sh_command)}`
Output:
```
{uncode(check_command_output(sh_command).decode())}
{uncode(check_command_output(sh_command.split(" ")).decode())}
```
""",
message,