Files
2024-02-15 16:58:37 +03:00

23 lines
869 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from aiogram import types
from aiogram.filters import Command
from neuroapi import neuroapi
from .handler import MessageHandlerABC
class EditCommand(MessageHandlerABC):
"""Command to edit posts"""
filter = Command('edit')
async def _command(self, message: types.Message):
command = message.text.split(' ', 2)
if len(command)<3:
await message.reply('Недостаточно аргументов!')
return
try:
await neuroapi.post.edit_text_by_order_num(command[1], command[2], message.entities)
#TODO: Message Entities для уведомления об изменении поста
await message.reply(f'Текст поста успешно изменен на: {command[2]}')
except Exception as e:
await message.reply(f'Ошибка: {e}')