
    iL	                          S SK r  " S S5      rg)    Nc                   2    \ rS rSr  S	SSS\S\4S jjrSrg)
Stop   selfzpyrogram.Clientblockclear_handlersc                    ^ ^#    UU 4S jnU(       a  U" 5       I Sh  vN   T $ T R                   R                  U" 5       5        T $  N(7f)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.

    clear_handlers (``bool``, *optional*):
        Clear the already existing handlers on stop the client.
        Default to True.

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

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

Example:
    .. code-block:: python

        import asyncio

        from pyrogram import Client


        async def main():
            app = Client("my_account")

            await app.start()
            ...  # Invoke API methods
            await app.stop()


        asyncio.run(main())
c                  t   >#    TR                  T S9I S h  vN   TR                  5       I S h  vN   g  N N7f)N)r   )	terminate
disconnect)r   r   s   L/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/utilities/stop.pydo_itStop.stop.<locals>.do_itC   s3     ...???//### @#s   848688N)loopcreate_task)r   r   r   r   s   ` ` r   stop	Stop.stop   sA     X	$ 'MM  II!!%'*	 s   AA)A N)TT)__name__
__module____qualname____firstlineno__boolr   __static_attributes__r       r   r   r      s.     #555 5 5r   r   )pyrogramr   r   r   r   <module>r      s   & 6 6r   