# app/src/core/telegram_errors.py

from __future__ import annotations

from aiogram.exceptions import TelegramBadRequest


def is_message_not_modified(exc: TelegramBadRequest) -> bool:
    return "message is not modified" in str(exc).lower()


def is_message_to_edit_not_found(exc: TelegramBadRequest) -> bool:
    text = str(exc).lower()

    return (
        "message to edit not found" in text
        or "message_id_invalid" in text
    )