
    h                     8    d dl mZ erd dlZ G d d          ZdS )    )TYPE_CHECKINGNc                        e Zd ZddddefdZdS )StopTselfzhydrogram.Clientblockc                     K    fd}|r |             d{V  n" j                              |                        S )a  Stop the Client.

        This method disconnects the client from Telegram and stops the underlying tasks.

        Parameters:
            block (``bool``, *optional*):
                Blocks the code execution until the client has been stopped. It is useful with ``block=False`` in case
                you want to stop the own client *within* a handler in order not to cause a deadlock.
                Defaults to True.

        Returns:
            :obj:`~hydrogram.Client`: The stopped client itself.

        Raises:
            ConnectionError: In case you try to stop an already stopped client.

        Example:
            .. code-block:: python

                from hydrogram import Client

                app = Client("my_account")


                async def main():
                    await app.start()
                    ...  # Invoke API methods
                    await app.stop()


                app.run(main())
        c                  t   K                                      d {V                                    d {V  d S )N)	terminate
disconnect)r   s   `/var/www/html/auto_sub_bot/venv/lib/python3.11/site-packages/hydrogram/methods/utilities/stop.pydo_itzStop.stop.<locals>.do_it=   sQ      .."""""""""//###########    N)loopcreate_task)r   r   r   s   `  r   stopz	Stop.stop   se      D	$ 	$ 	$ 	$ 	$  	+%''MMMMMMMMI!!%%''***r   N)T)__name__
__module____qualname__boolr    r   r   r   r      s<        + ++ +D + + + + + +r   r   )typingr   	hydrogramr   r   r   r   <module>r      s_   ( !           , , , , , , , , , ,r   