o
    -˜Žj¨
  ã                   @   s>   d dl mZ d dlZd dlmZ d dlmZ G dd„ dƒZdS )é    )ÚUnionN)Úraw)Útypesc                   @   s>   e Zd Z			ddddeeef dededed	efd
d„ZdS )Ú
AddContactÚ FÚselfzpyrogram.ClientÚuser_idÚ
first_nameÚ	last_nameÚphone_numberÚshare_phone_numberc              	   Ã   sF   �|   tjjj|  |¡I dH ||||d�¡I dH }tj | |j	d ¡S )aG  Add an existing Telegram user as contact, even without a phone number.

        .. include:: /_includes/usable-by/users.rst

        Parameters:
            user_id (``int`` | ``str``):
                Unique identifier (int) or username (str) of the target user.
                You can also use user profile link in form of *t.me/<username>* (str).

            first_name (``str``):
                User's first name.

            last_name (``str``, *optional*):
                User's last name.

            phone_number (``str``, *optional*):
                User's phone number.

            share_phone_number (``bool``, *optional*):
                Whether or not to share the phone number with the user.
                Defaults to False.

        Returns:
            :obj:`~pyrogram.types.User`: On success the user is returned.

        Example:
            .. code-block:: python

                # Add contact by id
                await app.add_contact(12345678, "Foo")

                # Add contact by username
                await app.add_contact("username", "Bar")
        N)Úidr	   r
   ÚphoneÚadd_phone_privacy_exceptionr   )
Úinvoker   Ú	functionsÚcontactsr   Úresolve_peerr   ÚUserÚ_parseÚusers)r   r   r	   r
   r   r   Úr© r   úb/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/contacts/add_contact.pyÚadd_contact   s   €*û
ÿ
zAddContact.add_contactN)r   r   F)Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrÚboolr   r   r   r   r   r      s"    úÿ
þýüûúr   )Útypingr   Úpyrogramr   r   r   r   r   r   r   Ú<module>   s
   