o
    -˜ŽjZ  ã                   @   s&   d dl Z d dlmZ G dd„ dƒZdS )é    N)ÚSessionc                   @   s   e Zd Zdddefdd„ZdS )ÚConnectÚselfzpyrogram.ClientÚreturnc                 Ã   s|   �| j rtdƒ‚|  ¡ I dH  t| | j ¡ I dH | j ¡ I dH | j ¡ I dH ƒ| _| j 	¡ I dH  d| _ t
| j ¡ I dH ƒS )ah  
        Connect the client to Telegram servers.

        Returns:
            ``bool``: On success, in case the passed-in session is authorized, True is returned. Otherwise, in case
            the session needs to be authorized, False is returned.

        Raises:
            ConnectionError: In case you try to connect an already connected client.
        zClient is already connectedNT)Úis_connectedÚConnectionErrorÚload_sessionr   ÚstorageÚdc_idÚauth_keyÚ	test_modeÚsessionÚstartÚboolÚuser_id)r   © r   úZ/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/auth/connect.pyÚconnect   s   €þzConnect.connectN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r      s    ÿþr   )ÚpyrogramÚpyrogram.sessionr   r   r   r   r   r   Ú<module>   s   