from aiogram.types import Message
from aiogram.dispatcher.filters import IDFilter, IsReplyFilter

from app.config import SUPERUSER_ID
from app.loader import dp


@dp.message_handler(
    IDFilter(chat_id=SUPERUSER_ID), IsReplyFilter(True), content_types="any"
)
async def send_report_response(msg: Message, reply: Message):
    is_forward = bool(getattr(reply, 'forward_from'))

    if not is_forward:
        return None

    chat_id = reply.forward_from.id
    await msg.bot.send_message(reply.forward_from.id, 'Ответ на репорт:')
    await msg.copy_to(chat_id, disable_notification=True)

    return await msg.answer('Ответ отправлен.')
