
    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)	RemoveHandlerselfzpyrogram.Clienthandlerr   groupc                 l    t        |t              rd| _        y| j                  j	                  ||       y)a  Remove a previously-registered update handler.

        Make sure to provide the right group where the handler was added in. You can use the return value of the
        :meth:`~pyrogram.Client.add_handler` method, a tuple of *(handler, group)*, and pass it directly.

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

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

        Example:
            .. code-block:: python

                from pyrogram import Client
                from pyrogram.handlers import MessageHandler

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

                app = Client("my_account")

                handler = app.add_handler(MessageHandler(hello))

                # Starred expression to unpack (handler, group)
                app.remove_handler(*handler)

                app.run()
        N)
isinstancer   disconnect_handler
dispatcherremove_handler)r   r   r	   s      \/var/www/files/kim/lib/python3.12/site-packages/pyrogram/methods/utilities/remove_handler.pyr   zRemoveHandler.remove_handler   s,    F g01&*D#OO**7E:    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   