o
    
{gE                     @   s   d dl Z G dd dZdS )    Nc                   @   s"   e Zd Z	ddddefddZdS )	StopTselfzpyrogram.Clientblockc                    s4    fdd}|r| I dH   S  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:`~pyrogram.Client`: The stopped client itself.

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

        Example:
            .. code-block:: python

                from pyrogram import Client

                app = Client("my_account")


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


                app.run(main())
        c                      s"      I d H    I d H  d S )N)	terminate
disconnect r   r   |/var/www/bot.gig.net.ua/public_html/telegram/P1/HellBot/venv/lib/python3.10/site-packages/pyrogram/methods/utilities/stop.pydo_it<   s   zStop.stop.<locals>.do_itN)loopcreate_task)r   r   r
   r   r   r	   stop   s   %z	Stop.stopN)T)__name__
__module____qualname__boolr   r   r   r   r	   r      s    r   )pyrogramr   r   r   r   r	   <module>   s   