
    ;Sid?                     0    d dl mZ d dlmZ  G d d      Zy)   )types)get_input_peerc                   b   e Zd ZdZd Zed        Zed        Zed        Zed        Z	ed        Z
ed        Zed	        Zed
        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Z ed        Z!ed        Z"ed         Z#ed!        Z$ed"        Z%ed#        Z&ed$        Z'ed%        Z(ed&        Z)d' Z*d( Z+y))*AdminLogEventa  
    Represents a more friendly interface for admin log events.

    Members:
        original (:tl:`ChannelAdminLogEvent`):
            The original :tl:`ChannelAdminLogEvent`.

        entities (`dict`):
            A dictionary mapping user IDs to :tl:`User`.

            When `old` and `new` are :tl:`ChannelParticipant`, you can
            use this dictionary to map the ``user_id``, ``kicked_by``,
            ``inviter_id`` and ``promoted_by`` IDs to their :tl:`User`.

        user (:tl:`User`):
            The user that caused this action (``entities[original.user_id]``).

        input_user (:tl:`InputPeerUser`):
            Input variant of `user`.
    c                 |    || _         || _        ||j                     | _        t	        | j                        | _        y N)originalentitiesuser_iduserr   
input_user)selfr	   r
   s      e/var/www/OnlineNewsSite/project/venv/lib/python3.12/site-packages/telethon/tl/custom/adminlogevent.py__init__zAdminLogEvent.__init__   s2      X--.	(3    c                 .    | j                   j                  S )z'
        The ID of this event.
        )r	   idr   s    r   r   zAdminLogEvent.id    s    
 }}r   c                 .    | j                   j                  S )z4
        The date when this event occurred.
        )r	   dater   s    r   r   zAdminLogEvent.date'   s    
 }}!!!r   c                 .    | j                   j                  S )z?
        The ID of the user that triggered this event.
        )r	   r   r   s    r   r   zAdminLogEvent.user_id.   s    
 }}$$$r   c                 .    | j                   j                  S )z@
        The original :tl:`ChannelAdminLogEventAction`.
        )r	   actionr   s    r   r   zAdminLogEvent.action5   s    
 }}###r   c                    | j                   j                  }t        |t        j                  t        j
                  t        j                  t        j                  t        j                  f      r|j                  S t        |t        j                        r|j                  S t        |t        j                        r|j                  S t        |t        j                        r|j                  S t        |t        j                   t        j"                  f      r|j$                  S t        |t        j&                  t        j(                  t        j*                  f      r|j,                   S t        |t        j.                        r|j0                  S t        |t        j2                        r|j4                  S t        |t        j6                        r|j8                  S t        |t        j:                  t        j<                  t        j>                  f      r|j@                  S t        |t        jB                        r|jD                  S y)z/
        The old value from the event.
        N)#r	   r   
isinstancer   %ChannelAdminLogEventActionChangeAbout%ChannelAdminLogEventActionChangeTitle(ChannelAdminLogEventActionChangeUsername(ChannelAdminLogEventActionChangeLocation*ChannelAdminLogEventActionChangeHistoryTTL
prev_value%ChannelAdminLogEventActionChangePhoto
prev_photo*ChannelAdminLogEventActionChangeStickerSetprev_stickerset%ChannelAdminLogEventActionEditMessageprev_message0ChannelAdminLogEventActionParticipantToggleAdmin.ChannelAdminLogEventActionParticipantToggleBanprev_participant'ChannelAdminLogEventActionToggleInvites0ChannelAdminLogEventActionTogglePreHistoryHidden*ChannelAdminLogEventActionToggleSignatures	new_value'ChannelAdminLogEventActionDeleteMessagemessage-ChannelAdminLogEventActionDefaultBannedRightsprev_banned_rights*ChannelAdminLogEventActionDiscardGroupCallcall.ChannelAdminLogEventActionExportedInviteDelete.ChannelAdminLogEventActionExportedInviteRevoke1ChannelAdminLogEventActionParticipantJoinByInviteinvite,ChannelAdminLogEventActionExportedInviteEditprev_inviter   oris     r   oldzAdminLogEvent.old<   s   
 mm""c;;;;>>>>@@
  >>!UHHI>>!UMMN&&&UHHI###FFDD
  '''==FF@@
 
 }}$$UJJK;;UPPQ)))UMMN88O@@@@CC
 
 ::UOOP??" Qr   c                    | j                   j                  }t        |t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  f      r|j                  S t        |t        j                        r|j                  S t        |t        j                        r|j                   S t        |t        j"                        r|j$                  S t        |t        j&                  t        j(                  f      r|j*                  S t        |t        j,                  t        j.                  f      r|j0                  S t        |t        j2                        r|j4                  S t        |t        j6                        r|j8                  S t        |t        j:                        r|j<                  S t        |t        j>                  t        j@                  f      r|j0                  S t        |t        jB                        r|jD                  S t        |t        jF                        r|jH                  S y)z5
        The new value present in the event.
        N)%r	   r   r   r   r   r   r   r+   r,   r-   r   r    r.   r"   	new_photor$   new_stickersetr&   new_messager(   r)   new_participant+ChannelAdminLogEventActionParticipantInvite+ChannelAdminLogEventActionParticipantVolumeparticipantr1   new_banned_rights"ChannelAdminLogEventActionStopPollr0   (ChannelAdminLogEventActionStartGroupCallr4   )ChannelAdminLogEventActionParticipantMute+ChannelAdminLogEventActionParticipantUnmute0ChannelAdminLogEventActionToggleGroupCallSetting
join_mutedr9   
new_inviter;   s     r   newzAdminLogEvent.newj   s   
 mm""c;;;;>>==FF@@>>@@	
 	 == UHHI== UMMN%%%UHHI??"FFDD
  &&&====
  ??"UPPQ(((UEEF;;UKKL88O??AA
  ??"USST>>!UOOP>>! Qr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the channel's about was changed or not.

        If `True`, `old` and `new` will be present as `str`.
        )r   r	   r   r   r   r   s    r   changed_aboutzAdminLogEvent.changed_about   (     $--..EEG 	Gr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the channel's title was changed or not.

        If `True`, `old` and `new` will be present as `str`.
        )r   r	   r   r   r   r   s    r   changed_titlezAdminLogEvent.changed_title   rQ   r   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the channel's username was changed or not.

        If `True`, `old` and `new` will be present as `str`.
        )r   r	   r   r   r   r   s    r   changed_usernamezAdminLogEvent.changed_username   (     $--..HHJ 	Jr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the channel's photo was changed or not.

        If `True`, `old` and `new` will be present as :tl:`Photo`.
        )r   r	   r   r   r"   r   s    r   changed_photozAdminLogEvent.changed_photo   rQ   r   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the channel's sticker set was changed or not.

        If `True`, `old` and `new` will be present as :tl:`InputStickerSet`.
        )r   r	   r   r   r$   r   s    r   changed_sticker_setz!AdminLogEvent.changed_sticker_set   (     $--..JJL 	Lr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a message in this channel was edited or not.

        If `True`, `old` and `new` will be present as
        `Message <telethon.tl.custom.message.Message>`.
        )r   r	   r   r   r&   r   s    r   changed_messagezAdminLogEvent.changed_message   s(     $--..EEG 	Gr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a message in this channel was deleted or not.

        If `True`, `old` will be present as
        `Message <telethon.tl.custom.message.Message>`.
        )r   r	   r   r   r/   r   s    r   deleted_messagezAdminLogEvent.deleted_message   s(     $--..GGI 	Ir   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the permissions for an admin in this channel
        changed or not.

        If `True`, `old` and `new` will be present as
        :tl:`ChannelParticipant`.
        )r   r	   r   r   r(   r   s    r   changed_adminzAdminLogEvent.changed_admin   s)     MM  BBD 	Dr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a message in this channel was edited or not.

        If `True`, `old` and `new` will be present as
        :tl:`ChannelParticipant`.
        )r   r	   r   r   r)   r   s    r   changed_restrictionsz"AdminLogEvent.changed_restrictions   s)     MM  @@B 	Br   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the invites in the channel were toggled or not.

        If `True`, `old` and `new` will be present as `bool`.
        )r   r	   r   r   r+   r   s    r   changed_inviteszAdminLogEvent.changed_invites   s(     $--..GGI 	Ir   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the location setting of the channel has changed or not.

        If `True`, `old` and `new` will be present as :tl:`ChannelLocation`.
        )r   r	   r   r   r   r   s    r   changed_locationzAdminLogEvent.changed_location  rV   r   c                 ^    t        | j                  j                  t        j                        S )z]
        Whether `user` joined through the channel's
        public username or not.
        )r   r	   r   r   )ChannelAdminLogEventActionParticipantJoinr   s    r   joinedzAdminLogEvent.joined  s(     $--..IIK 	Kr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a new user joined through an invite
        link to the channel or not.

        If `True`, `new` will be present as
        :tl:`ChannelParticipant`.
        )r   r	   r   r   rC   r   s    r   joined_invitezAdminLogEvent.joined_invite  s(     $--..KKM 	Mr   c                 ^    t        | j                  j                  t        j                        S )z9
        Whether `user` left the channel or not.
        )r   r	   r   r   *ChannelAdminLogEventActionParticipantLeaver   s    r   leftzAdminLogEvent.left%  s(    
 $--..JJL 	Lr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether hiding the previous message history for new members
        in the channel was toggled or not.

        If `True`, `old` and `new` will be present as `bool`.
        )r   r	   r   r   r,   r   s    r   changed_hide_historyz"AdminLogEvent.changed_hide_history-  s(     $--..PPR 	Rr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the message signatures in the channel were toggled
        or not.

        If `True`, `old` and `new` will be present as `bool`.
        )r   r	   r   r   r-   r   s    r   changed_signaturesz AdminLogEvent.changed_signatures8  s(     $--..JJL 	Lr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a new message in this channel was pinned or not.

        If `True`, `new` will be present as
        `Message <telethon.tl.custom.message.Message>`.
        )r   r	   r   r   &ChannelAdminLogEventActionUpdatePinnedr   s    r   changed_pinzAdminLogEvent.changed_pinC  s(     $--..FFH 	Hr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the default banned rights were changed or not.

        If `True`, `old` and `new` will
        be present as :tl:`ChatBannedRights`.
        )r   r	   r   r   r1   r   s    r   changed_default_banned_rightsz+AdminLogEvent.changed_default_banned_rightsN  s(     $--..MMO 	Or   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a poll was stopped or not.

        If `True`, `new` will be present as
        `Message <telethon.tl.custom.message.Message>`.
        )r   r	   r   r   rG   r   s    r   stopped_pollzAdminLogEvent.stopped_pollY  s(     $--..BBD 	Dr   c                 ^    t        | j                  j                  t        j                        S )z}
        Whether a group call was started or not.

        If `True`, `new` will be present as :tl:`InputGroupCall`.
        )r   r	   r   r   rH   r   s    r   started_group_callz AdminLogEvent.started_group_calld  rV   r   c                 ^    t        | j                  j                  t        j                        S )z}
        Whether a group call was started or not.

        If `True`, `old` will be present as :tl:`InputGroupCall`.
        )r   r	   r   r   r3   r   s    r   discarded_group_callz"AdminLogEvent.discarded_group_calln  r[   r   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a participant was muted in the ongoing group call or not.

        If `True`, `new` will be present as :tl:`GroupCallParticipant`.
        )r   r	   r   r   rI   r   s    r   
user_mutedzAdminLogEvent.user_mutedx  s(     $--..IIK 	Kr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a participant was unmuted from the ongoing group call or not.

        If `True`, `new` will be present as :tl:`GroupCallParticipant`.
        )r   r	   r   r   rJ   r   s    r   user_unmuttedzAdminLogEvent.user_unmutted  (     $--..KKM 	Mr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the group call settings were changed or not.

        If `True`, `new` will be `True` if new users are muted on join.
        )r   r	   r   r   rK   r   s    r   changed_call_settingsz#AdminLogEvent.changed_call_settings  s(     $--..PPR 	Rr   c                 ^    t        | j                  j                  t        j                        S )a;  
        Whether the Time To Live of the message history has changed.

        Messages sent after this change will have a ``ttl_period`` in seconds
        indicating how long they should live for before being auto-deleted.

        If `True`, `old` will be the old TTL, and `new` the new TTL, in seconds.
        )r   r	   r   r   r    r   s    r   changed_history_ttlz!AdminLogEvent.changed_history_ttl  s(     $--..JJL 	Lr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the exported chat invite has been deleted.

        If `True`, `old` will be the deleted :tl:`ExportedChatInvite`.
        )r   r	   r   r   r5   r   s    r   deleted_exported_invitez%AdminLogEvent.deleted_exported_invite  (     $--..NNP 	Pr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the exported chat invite has been edited.

        If `True`, `old` and `new` will be the old and new
        :tl:`ExportedChatInvite`, respectively.
        )r   r	   r   r   r9   r   s    r   edited_exported_invitez$AdminLogEvent.edited_exported_invite  s(     $--..LLN 	Nr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether the exported chat invite has been revoked.

        If `True`, `old` will be the revoked :tl:`ExportedChatInvite`.
        )r   r	   r   r   r6   r   s    r   revoked_exported_invitez%AdminLogEvent.revoked_exported_invite  r   r   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a new participant has joined with the use of an invite link.

        If `True`, `old` will be pre-existing (old) :tl:`ExportedChatInvite`
        used to join.
        )r   r	   r   r   r7   r   s    r   joined_by_invitezAdminLogEvent.joined_by_invite  s(     $--..QQS 	Sr   c                 ^    t        | j                  j                  t        j                        S )z
        Whether a participant's volume in a call has been changed.

        If `True`, `new` will be the updated :tl:`GroupCallParticipant`.
        )r   r	   r   r   rD   r   s    r   changed_user_volumez!AdminLogEvent.changed_user_volume  r   r   c                 ,    t        | j                        S r   )strr	   r   s    r   __str__zAdminLogEvent.__str__  s    4==!!r   c                 6    | j                   j                         S r   )r	   	stringifyr   s    r   r   zAdminLogEvent.stringify  s    }}&&((r   N),__name__
__module____qualname____doc__r   propertyr   r   r   r   r=   rN   rP   rS   rU   rX   rZ   r]   r_   ra   rc   re   rg   rj   rl   ro   rq   rs   rv   rx   rz   r|   r~   r   r   r   r   r   r   r   r   r   r   r    r   r   r   r      s$   (4     " " % % $ $ +# +#Z ." ."` G G G G J J G G L L G G I I 
D 
D 	B 	B I I J J K K 	M 	M L L R R L L H H O O D D J J L L K K M M R R 
L 
L P P N N P P S S M M")r   r   N)tlr   utilsr   r   r   r   r   <module>r      s     #V) V)r   