
    N[i*	                     8    d dl Z d dlmZ d dlmZ  G d d      Zy)    N)DisconnectHandler)Handlerc                   $    e Zd Z	 ddddddefdZy)	
AddHandlerselfzpyrogram.Clienthandlerr   groupc                     t        |t              r|j                  | _        ||fS | j                  j                  ||       ||fS )a'  Register an update handler.

        You can register multiple handlers, but at most one handler within a group will be used for a single update.
        To handle the same update more than once, register your handler using a different group id (lower group id
        == higher priority). This mechanism is explained in greater details at
        :doc:`More on Updates <../../topics/more-on-updates>`.

        Parameters:
            handler (``Handler``):
                The handler to be registered.

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

        Returns:
            ``tuple``: A tuple consisting of *(handler, group)*.

        Example:
            .. code-block:: python

                from pyrogram import Client
                from pyrogram.handlers import MessageHandler

                async def hello(client, message):
                    print(message)

                app = Client("my_account")

                app.add_handler(MessageHandler(hello))

                app.run()
        )
isinstancer   callbackdisconnect_handler
dispatcheradd_handler)r   r   r	   s      Y/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/utilities/add_handler.pyr   zAddHandler.add_handler   sJ    J g01&-&6&6D# ~ OO''7~    N)r   )__name__
__module____qualname__intr    r   r   r   r      s&     *** *r   r   )pyrogrampyrogram.handlersr   pyrogram.handlers.handlerr   r   r   r   r   <module>r      s   &  / -+ +r   