Третий стрим

This commit is contained in:
2024-03-17 21:28:49 +04:00
parent a498a04481
commit 17cd64bdbc
29 changed files with 618 additions and 50 deletions

View File

@ -3,10 +3,15 @@ import subprocess
from aiogram.types import Message
from app import views
from app.utils.text_splitter import split_text
async def execute_command(message: Message):
user_command = message.text.split()[1:]
sub = subprocess.check_output(user_command, shell=True)
res = sub.decode().replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
await message.answer(views.user_command(res), parse_mode="HTML")
messages = split_text(res)
for m in messages:
await message.answer(views.user_command(m), parse_mode="HTML")