
    hR                     L    d dl Z d dlmZ d dlmZ erd dlZ G d d          ZdS )    N)TYPE_CHECKING)idlec                       e Zd ZdddZdS )RunNselfhydrogram.Clientc                 @   t          j                    }|j        }| ||           dS |                                rt	          d           ||                                             |t                                  ||                                            dS )a  Start the client, idle the main script and finally stop the client.

        When calling this method without any argument it acts as a convenience method that calls
        :meth:`~hydrogram.Client.start`, :meth:`~hydrogram.idle` and :meth:`~hydrogram.Client.stop`
        in sequence. It makes running a single client less verbose.

        In case a coroutine is passed as argument, runs the coroutine until it's completed and
        doesn't do any client operation. This is almost the same as :py:obj:`asyncio.run` except
        for the fact that Hydrogram's ``run`` uses the current event loop instead of a new one.

        If you want to run multiple clients at once, see :meth:`hydrogram.compose`.

        Parameters:
            coroutine (``Coroutine``, *optional*):
                Pass a coroutine to run it until it completes.

        Raises:
            ConnectionError: In case you try to run an already started client.

        Example:
            .. code-block:: python

                from hydrogram import Client

                app = Client("my_account")
                ...  # Set handlers up
                app.run()

            .. code-block:: python

                from hydrogram import Client

                app = Client("my_account")


                async def main():
                    async with app:
                        print(await app.get_me())


                app.run(main())
        NzYou must call client.run() method outside of an asyncio event loop. Otherwise, you can use client.start(), client.idle(), and client.stop() methods. Refer to https://docs.hydrogram.org/en/latest/api/methods/run.html)asyncioget_event_looprun_until_complete
is_runningRuntimeErrorstartr   stop)r   	coroutineloopruns       _/var/www/html/auto_sub_bot/venv/lib/python3.11/site-packages/hydrogram/methods/utilities/run.pyr   zRun.run   s    V %''% C	NNNNN   "b   C

CKKKC		    )N)r   r   )__name__
__module____qualname__r    r   r   r   r      s-        : : : : : : :r   r   )r
   typingr    hydrogram.methods.utilities.idler   	hydrogramr   r   r   r   <module>r      sz   (              1 1 1 1 1 1 ; ; ; ; ; ; ; ; ; ;r   