12 lines
320 B
Python
12 lines
320 B
Python
import subprocess
|
|
|
|
from aiogram.types import Message
|
|
|
|
|
|
async def execute_command(message: Message):
|
|
user_command = message.text.split()[1:]
|
|
print(user_command)
|
|
sub = subprocess.check_output(user_command)
|
|
# print(sub)
|
|
await message.answer(f"<pre><code>{sub.decode()}</code></pre>", parse_mode="HTML")
|