13 lines
383 B
Python
13 lines
383 B
Python
import subprocess
|
|
|
|
from aiogram.types import Message
|
|
|
|
from app import views
|
|
|
|
|
|
async def execute_command(message: Message):
|
|
user_command = message.text.split()[1:]
|
|
sub = subprocess.check_output(user_command, shell=True)
|
|
res = sub.decode().replace("&", "&").replace("<", "<").replace(">", ">")
|
|
await message.answer(views.user_command(res), parse_mode="HTML")
|