o
    -˜Žj2
  ã                   @   s:   d dl mZmZ d dlZd dlmZmZ G dd„ dƒZdS )é    )ÚListÚUnionN)ÚrawÚtypesc                
   @   sF   e Zd Zdddeeeeeeef  f deded df fdd„ZdS )	ÚDeleteContactsÚselfzpyrogram.ClientÚuser_idsÚreturnz
types.UserNc                 ƒ   sz   �t |tƒ}|s|g}ˆ  tjjj‡ fdd„|D ƒI dH d�¡I dH }|js(dS t 	‡ fdd„|j
D ƒ¡}|r9|S |d S )aÊ  Delete contacts from your Telegram address book.

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

        Parameters:
            user_ids (``int`` | ``str`` | List of ``int`` or ``str``):
                A single user id/username or a list of user identifiers (id or username).
                You can also use user profile link in form of *t.me/<username>* (str).

        Returns:
            :obj:`~pyrogram.types.User` | List of :obj:`~pyrogram.types.User` | ``None``: In case *user_ids* was an
            integer or a string, a single User object is returned. In case *user_ids* was a list, a list of User objects
            is returned. In case nothing changed after calling the method (for example, when deleting a non-existent
            contact), None is returned.

        Example:
            .. code-block:: python

                await app.delete_contacts(user_id)
                await app.delete_contacts([user_id1, user_id2, user_id3])
        c                 “   s   �g | ]
}ˆ   |¡I d H ‘qS )N)Úresolve_peer©Ú.0Úi©r   © úf/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/contacts/delete_contacts.pyÚ
<listcomp>;   s   € z2DeleteContacts.delete_contacts.<locals>.<listcomp>N)Úidc                    s   g | ]	}t j ˆ |¡‘qS r   )r   ÚUserÚ_parser   r   r   r   r   B   s    r   )Ú
isinstanceÚlistÚinvoker   Ú	functionsÚcontactsr   Úupdatesr   r   Úusers)r   r   Úis_listÚrr   r   r   r   Údelete_contacts   s   €
ÿ
ÿzDeleteContacts.delete_contacts)Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrr   r   r   r   r   r   r      s    ÿþýr   )Útypingr   r   Úpyrogramr   r   r   r   r   r   r   Ú<module>   s   