
    <Si#                     *    d dl mZ d Z G d d      Zy)   )typesc                       fd}||dS )z
    Helper method to build properties that return `True` if the user is an
    administrator of a normal chat, or otherwise return `True` if the user
    has a specific permission being an admin of a channel.
    c                 x    | j                   sy| j                  ryt        | j                  j                        S )NFT)is_adminis_chatgetattrparticipantadmin_rights)self
field_names    n/var/www/OnlineNewsSite/project/venv/lib/python3.12/site-packages/telethon/tl/custom/participantpermissions.pyfgetz_admin_prop.<locals>.fget
   s0    }}<<t''44jAA    )r   doc )r   r   r   s   `  r   _admin_propr      s    B %%r   c                      e Zd ZdZdefdZed        Zed        Zed        Z	ed        Z
ed        Zed	        Z edi  ed
d      Z edi  edd      Z edi  edd      Z edi  edd      Z edi  edd      Z edi  edd      Z edi  edd      Z edi  edd      Z edi  edd      Zy)ParticipantPermissionsa  
    Participant permissions information.

    The properties in this objects are boolean values indicating whether the
    user has the permission or not.

    Example
        .. code-block:: python

            permissions = ...

            if permissions.is_banned:
                "this user is banned"
            elif permissions.is_admin:
                "this user is an administrator"
    chatc                      || _         || _        y )N)r	   r   )r   r	   r   s      r   __init__zParticipantPermissions.__init__&   s    &r   c                     | j                   xs4 t        | j                  t        j                  t        j
                  f      S )z
        Whether the user is an administrator of the chat or not. The creator
        also counts as begin an administrator, since they have all permissions.
        )
is_creator
isinstancer	   r   ChannelParticipantAdminChatParticipantAdminr   s    r   r   zParticipantPermissions.is_admin*   s<      *T-=-=))&&@
 # 	r   c                 j    t        | j                  t        j                  t        j                  f      S )zE
        Whether the user is the creator of the chat or not.
        )r   r	   r   ChannelParticipantCreatorChatParticipantCreatorr   s    r   r   z!ParticipantPermissions.is_creator5   s0    
 $**++((-
  	r   c                     t        | j                  t        j                  t        j                  t        j
                  f      S )z
        Whether the user is a normal user of the chat (not administrator, but
        not banned either, and has no restrictions applied).
        )r   r	   r   ChannelParticipantChatParticipantChannelParticipantSelfr   s    r   has_default_permissionsz.ParticipantPermissions.has_default_permissions?   s9     $**$$!!((-
  	r   c                 J    t        | j                  t        j                        S )z9
        Whether the user is banned in the chat.
        )r   r	   r   ChannelParticipantBannedr   s    r   	is_bannedz ParticipantPermissions.is_bannedK   s    
 $**E,J,JKKr   c                 J    t        | j                  t        j                        S )z1
        Whether the user left the chat.
        )r   r	   r   ChannelParticipantLeftr   s    r   has_leftzParticipantPermissions.has_leftR   s    
 $**E,H,HIIr   c                     | j                   sy| j                  r| j                  S | j                  j                  j
                  S )z{
        Whether the administrator can add new administrators with the same or
        less permissions than them.
        F)r   r   r   r	   r
   
add_adminsr   s    r   r-   z!ParticipantPermissions.add_adminsY   s7     }}<<??",,777r   	ban_userszC
        Whether the administrator can ban other users or not.
    pin_messagesz@
        Whether the administrator can pin messages or not.
    invite_userszF
        Whether the administrator can add new users to the chat.
    delete_messageszT
        Whether the administrator can delete messages from other participants.
    edit_messagesz:
        Whether the administrator can edit messages.
    post_messageszS
        Whether the administrator can post messages in the broadcast channel.
    change_infozx
        Whether the administrator can change the information about the chat,
        such as title or description.
    	anonymouszT
        Whether the administrator will remain anonymous when sending messages.
    manage_callzB
        Whether the user will be able to manage group calls.
    Nr   )__name__
__module____qualname____doc__boolr   propertyr   r   r%   r(   r+   r-   r   r.   r/   r0   r1   r2   r3   r4   r5   r6   r   r   r   r   r      s    $      	 	 L L J J 8 8  
;{ 5 	 
I  
k. ; 	 
L  
k. ; 	 
L  
-> A "	 
O  
{? =  	 
M  
{? =  	 
M  
[ 9 	 
K
  
;{ 5 	 
I  
[ 9 	 
Kr   r   N) r   r   r   r   r   r   <module>r>      s    &"u
 u
r   