Use this decorator to automatically register a function for handling user status updates.
        This does the same thing as :meth:`add_handler` using the :class:`UserStatusHandler`.

        Args:
            filters (:obj:`Filters <pyrogram.Filters>`):
                Pass one or more filters to allow only a subset of UserStatus updated to be passed in your function.

            group (``int``, *optional*):
                The group identifier, defaults to 0.

def on_user_status(
        self=None,
        filters=None,
        group: int = 0
    ) -> callable:
        """Use this decorator to automatically register a function for handling user status updates.
        This does the same thing as :meth:`add_handler` using the :class:`UserStatusHandler`.

        Args:
            filters (:obj:`Filters <pyrogram.Filters>`):
                Pass one or more filters to allow only a subset of UserStatus updated to be passed in your function.

            group (``int``, *optional*):
                The group identifier, defaults to 0.
        """

        def decorator(func: callable) -> Tuple[Handler, int]:
            if isinstance(func, tuple):
                func = func[0].callback

            handler = pyrogram.UserStatusHandler(func, filters)

            if isinstance(self, Filter):
                return pyrogram.UserStatusHandler(func, self), group if filters is None else filters

            if self is not None:
                self.add_handler(handler, group)

            return handler, group

        return decorator