#  Rubio - Rubika API library for python
#  Copyright (C) 2025-present Rubio <https://github.com/RubioTeam>
#  Github - https://github.com/RubioTeam/rubio.core


from __future__ import annotations

from typing import Optional, Callable
from rubio.core.filters import Filter
import rubio.core


class OnInlineMessage:
    def on_inline_message(
        self: rubio.core.Client,
        filters: Optional[Filter] = None,
        group: int = 0
    ):
        def decorator(func: Callable):
            handler = rubio.core.Handler(
                callback=func,
                filters=filters
            )

            self.dispatcher.add_handler(
                rubio.core.enums.HandlerType.INLINE,
                handler,
                group
            )

            return func

        return decorator