o
    -˜Žjâ  ã                   @   s6   d dl mZmZ d dlZd dlmZ G dd„ dƒZdS )é    )ÚUnionÚListN)Úrawc                   @   sR   e Zd Z	ddddeeef deeeef eeeef  f dedef
dd	„Zd
S )ÚAddChatMemberséd   Úselfzpyrogram.ClientÚchat_idÚuser_idsÚforward_limitÚreturnc                 ƒ   s¢   �ˆ   |¡I dH }t|tƒs|g}t|tjjƒr6|D ]}ˆ  tjjj	|j
ˆ   |¡I dH |d�¡I dH  qdS ˆ  tjjj|‡ fdd„|D ƒI dH d�¡I dH  dS )aÌ  Add new chat members to a group, supergroup or channel

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

        Parameters:
            chat_id (``int`` | ``str``):
                The group, supergroup or channel id or chat/channel public link

            user_ids (``int`` | ``str`` | List of ``int`` or ``str``):
                Users to add in the chat
                You can pass an ID (int), username (str) or phone number (str).
                Multiple users can be added by passing a list of IDs, usernames or phone numbers.
                You can also use user profile link in form of *t.me/<username>* (str).

            forward_limit (``int``, *optional*):
                How many of the latest messages you want to forward to the new members. Pass 0 to forward none of them.
                Only applicable to basic groups (the argument is ignored for supergroups or channels).
                Defaults to 100 (max amount).

        Returns:
            ``bool``: On success, True is returned.

        Example:
            .. code-block:: python

                # Add one member to a group or channel
                await app.add_chat_members(chat_id, user_id)

                # Add multiple members to a group or channel
                await app.add_chat_members(chat_id, [user_id1, user_id2, user_id3])

                # Change forward_limit (for basic groups only)
                await app.add_chat_members(chat_id, user_id, forward_limit=25)
        N)r   Úuser_idÚ	fwd_limitc                 “   s   �g | ]
}ˆ   |¡I d H ‘qS )N)Úresolve_peer)Ú.0r   ©r   © úd/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/chats/add_chat_members.pyÚ
<listcomp>U   s
   € ÿÿz3AddChatMembers.add_chat_members.<locals>.<listcomp>)ÚchannelÚusersT)r   Ú
isinstanceÚlistr   ÚtypesÚInputPeerChatÚinvokeÚ	functionsÚmessagesÚAddChatUserr   ÚchannelsÚInviteToChannel)r   r   r	   r
   Úpeerr   r   r   r   Úadd_chat_members   s.   €(
ýÿö

þþ
ÿ
zAddChatMembers.add_chat_membersN)r   )	Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrr   Úboolr!   r   r   r   r   r      s    üÿ
þýüûr   )Útypingr   r   Úpyrogramr   r   r   r   r   r   Ú<module>   s   