
    iF                     d    S SK r S SKJr  S SKrS SKJr  \ R
                  " \5      r " S S5      rg)    N)List)rawc                   :    \ rS rSrS/ S.SSS\S\\   4S jjrS	rg
)Start   F)use_qr
except_idsselfzpyrogram.Clientr   r	   c                  #    U R                  5         U R                  5       I Sh  vN n U(       d<  U(       a   SSKnU R                  US9I Sh  vN   OU R                  5       I Sh  vN   U R                  (       a  U R                  R                  5       I Sh  vN (       dn  U R                  [        R                  R                  R                  5       5      I Sh  vN R                   U l        [
        R%                  SU R"                  5        U R                  [        R                  R&                  R)                  5       5      I Sh  vN   U R+                  5       I Sh  vN U l        U R/                  5       I Sh  vN   U $  GNe GN=! [         a2    [
        R                  S5        U R                  5       I Sh  vN     GN]f = f GNf GN6 N N Nr NW! [0        [2        4 a    U R5                  5       I Sh  vN    e f = f7f)a  Start the client.

This method connects the client to Telegram and, in case of new sessions, automatically manages the
authorization process using an interactive prompt.

.. note::

    You should install ``qrcode`` package if you want to use QR code authorization.

Parameters:
    use_qr (``bool``, *optional*):
        Use QR code authorization instead of the interactive prompt.
        For new authorizations only.
        Defaults to False.

    except_ids (List of ``int``, *optional*):
        List of already logged-in user IDs, to prevent logging in twice with the same user.

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

Raises:
    ConnectionError: In case you try to start an already started 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())
Nr   )r	   z>qrcode package not found, falling back to authorization promptzTakeout session %s initiated)load_pluginsconnectqrcodeauthorize_qrImportErrorlogwarning	authorizetakeoutstorageis_botinvoker   	functionsaccountInitTakeoutSessionid
takeout_idinfoupdatesGetStateget_meme
initialize	ExceptionKeyboardInterrupt
disconnect)r
   r   r	   is_authorizedr   s        M/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/utilities/start.pystartStart.start   s~    \ 	"lln,	 /%"//:/FFF
 ..***||$,,*=*=*?$?$?)-S]]5J5J5]5]5_)`#`"d"d7I++cmm33<<>???
 !KKM)DG//###K5 - G& /$de"nn.../ +$?#` @
 *# ,- 	//###	s   $HFHG F FF G *G+2G GAG !G"A-G GG H'G(HGHF 2GGG	G GG G G G HH#H	HH		H)r!   r   N)	__name__
__module____qualname____firstlineno__boolr   intr(   __static_attributes__     r'   r   r      s7      "JJJ IJ Jr2   r   )	loggingtypingr   pyrogramr   	getLoggerr*   r   r   r1   r2   r'   <module>r7      s/   &    !K Kr2   