
    $Sh                     (    d dl Z  G d d          ZdS )    Nc                   "    e Zd Z	 ddddefdZdS )RestartTselfzpyrogram.Clientblockc                     K    fd}|r |             d{V  n" j                              |                        S )ae  Restart the Client.

        This method will first call :meth:`~pyrogram.Client.stop` and then :meth:`~pyrogram.Client.start` in a row in
        order to restart a client using a single method.

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

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

        Raises:
            ConnectionError: In case you try to restart a 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.restart()
                    ...  # Invoke other API methods
                    await app.stop()


                app.run(main())
        c                  t   K                                      d {V                                    d {V  d S )N)stopstart)r   s   h/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/pyrogram/methods/utilities/restart.pydo_itzRestart.restart.<locals>.do_it?   sM      ))++**,,    N)loopcreate_task)r   r   r   s   `  r   restartzRestart.restart   se      P	 	 	 	 	  	+%''MMMMMMMMI!!%%''***r   N)T)__name__
__module____qualname__boolr    r   r   r   r      sB         1 111 1 1 1 1 1r   r   )pyrogramr   r   r   r   <module>r      sB   & 2 2 2 2 2 2 2 2 2 2r   