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eeef ddddfdd	„Zd
S )ÚSetChatPermissionsÚselfzpyrogram.ClientÚchat_idÚpermissionsztypes.ChatPermissionsÚreturnz
types.Chatc              	   Ã   sÎ  �|j durEd}d}d}d}d}d}d}	d}
d}d}|j r1d}d}d}d}d}d}d}d}d}�nVd}d}d}d}d}d}d}d}d}�nB|  |¡I dH j}d}d}|jdur[|j n|j }|jdurh|j n|j }|jduru|j n|j }|jdur‚|j n|j }|jdur�|j n|j }|jdurœ|j n|j }|j	dur©|j	 n|j	 }|j
dur¶|j
 n|j
 }|jdurÃ|j n|j }|jdurÐ|j n|j }|jdurÝ|j n|j }|jdurê|j n|j }|jdur÷|j n|j }|jdu�r|j n|j }	|jdu�r|j n|j }
|jdu�r!|j n|j }|jdu�r/|j n|j }|jdu�rL|j�r@d}nd}|jdu �rL|j|_|jdu�r‡|j�rod}d}d}d}d}d}d}d}d}	d}
d}d}nd}d}d}d}d}d}d}d}d}	d}
d}d}|  tjjj|  |¡I dH tjjdi dd“d|“d|“d|“d	|“d
|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|	“d|
“d|“d|“Žd�¡I dH }tj | |j d ¡S )aî  Set default chat permissions for all members.

        You must be an administrator in the group or a supergroup for this to work and must have the
        *can_restrict_members* admin rights.

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

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

            permissions (:obj:`~pyrogram.types.ChatPermissions`):
                New default chat permissions.

        Returns:
            :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.

        Example:
            .. code-block:: python

                from pyrogram.types import ChatPermissions

                # Completely restrict chat
                await app.set_chat_permissions(chat_id, ChatPermissions())

                # Chat members can only send text messages and media messages
                await app.set_chat_permissions(
                    chat_id,
                    ChatPermissions(
                        can_send_messages=True,
                        can_send_media_messages=True
                    )
                )
        NFTÚ
until_dater   Úsend_messagesÚ
send_mediaÚembed_linksÚ
send_pollsÚchange_infoÚinvite_usersÚpin_messagesÚmanage_topicsÚsend_audiosÚ	send_docsÚ
send_gamesÚ	send_gifsÚsend_inlineÚsend_photosÚ
send_plainÚsend_roundvideosÚsend_stickersÚsend_videosÚsend_voices)ÚpeerÚbanned_rights© )!Ú	all_permsÚget_chatr   Úcan_add_web_page_previewsÚcan_send_pollsÚcan_change_infoÚcan_invite_usersÚcan_pin_messagesÚcan_manage_topicsÚcan_send_audiosÚcan_send_docsÚcan_send_gamesÚcan_send_gifsÚcan_send_inlineÚcan_send_photosÚcan_send_plainÚcan_send_roundvideosÚcan_send_stickersÚcan_send_videosÚcan_send_voicesÚcan_send_messagesÚcan_send_media_messagesÚinvoker   Ú	functionsÚmessagesÚEditChatDefaultBannedRightsÚresolve_peerr   ÚChatBannedRightsÚChatÚ_parse_chatÚchats)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Úold_permissionsÚrr    r    úh/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/chats/set_chat_permissions.pyÚset_chat_permissions   s  €
)ÿþýüûúùø	÷
öõôóòñðïîíìþ
ÿz'SetChatPermissions.set_chat_permissionsN)Ú__name__Ú
__module__Ú__qualname__r   ÚintÚstrrB   r    r    r    rA   r      s    ÿ
þýür   )Útypingr   Úpyrogramr   r   r   r    r    r    rA   Ú<module>   s
   