U
    ;g	                     @   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                   @   sB   e Zd Zdeeeeeeef  f eded df dddZdS )DeleteContactszpyrogram.Clientz
types.UserN)selfuser_idsreturnc                    sx   t |t}|s|g} tjjj fdd|D I dH dI dH }|jsNdS t	 fdd|j
D }|rp|S |d S )as  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).

        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)Zresolve_peer.0ir    i/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/contacts/delete_contacts.py
<listcomp>9   s     z2DeleteContacts.delete_contacts.<locals>.<listcomp>N)idc                    s   g | ]}t j |qS r   )r   ZUser_parser
   r   r   r   r   @   s     r   )
isinstancelistZinvoker   Z	functionsZcontactsr   Zupdatesr   r   users)r   r   Z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   Zpyrogramr   r   r   r   r   r   r   <module>   s   