o
    Xzjd?  ã                   @   s*   d dl mZ d dlmZ G dd„ dƒZdS )é   )Útypes)Úget_input_peerc                   @   sØ  e Zd ZdZdd„ Zedd„ ƒZedd„ ƒZedd	„ ƒZed
d„ ƒZ	edd„ ƒZ
edd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZed d!„ ƒZed"d#„ ƒZed$d%„ ƒZed&d'„ ƒZed(d)„ ƒZed*d+„ ƒZed,d-„ ƒZed.d/„ ƒZed0d1„ ƒZed2d3„ ƒZed4d5„ ƒZed6d7„ ƒZed8d9„ ƒZ ed:d;„ ƒZ!ed<d=„ ƒZ"ed>d?„ ƒZ#ed@dA„ ƒZ$edBdC„ ƒZ%edDdE„ ƒZ&edFdG„ ƒZ'edHdI„ ƒZ(edJdK„ ƒZ)dLdM„ Z*dNdO„ Z+dPS )QÚ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                 C   s(   || _ || _||j | _t| jƒ| _d S ©N)ÚoriginalÚentitiesÚuser_idÚuserr   Ú
input_user)Úselfr   r   © r   ú[/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telethon/tl/custom/adminlogevent.pyÚ__init__   s   zAdminLogEvent.__init__c                 C   ó   | j jS )z'
        The ID of this event.
        )r   Úid©r   r   r   r   r       ó   zAdminLogEvent.idc                 C   r   )z4
        The date when this event occurred.
        )r   Údater   r   r   r   r   '   r   zAdminLogEvent.datec                 C   r   )z?
        The ID of the user that triggered this event.
        )r   r   r   r   r   r   r   .   r   zAdminLogEvent.user_idc                 C   r   )z@
        The original :tl:`ChannelAdminLogEventAction`.
        )r   Úactionr   r   r   r   r   5   r   zAdminLogEvent.actionc                 C   s   | 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ƒr1|jS t|tjtjfƒr=|jS t|tjtjtjfƒrL|j S t|tjƒrU|jS t|tjƒr^|jS t|tjƒrg|jS t|tjtjtjfƒru|j S t|tj!ƒr~|j"S dS )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_messageÚ0ChannelAdminLogEventActionParticipantToggleAdminÚ.ChannelAdminLogEventActionParticipantToggleBanÚprev_participantÚ'ChannelAdminLogEventActionToggleInvitesÚ0ChannelAdminLogEventActionTogglePreHistoryHiddenÚ*ChannelAdminLogEventActionToggleSignaturesÚ	new_valueÚ'ChannelAdminLogEventActionDeleteMessageÚmessageÚ-ChannelAdminLogEventActionDefaultBannedRightsÚprev_banned_rightsÚ*ChannelAdminLogEventActionDiscardGroupCallÚcallÚ.ChannelAdminLogEventActionExportedInviteDeleteÚ.ChannelAdminLogEventActionExportedInviteRevokeÚ1ChannelAdminLogEventActionParticipantJoinByInviteÚinviteÚ,ChannelAdminLogEventActionExportedInviteEditÚprev_invite©r   Úorir   r   r   Úold<   sR   ûþýýÿzAdminLogEvent.oldc              
   C   s  | 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ƒr7|jS t|tjtjfƒrC|jS t|tjtjfƒrO|jS t|tjƒrX|jS t|tjƒra|jS t|tjƒrj|jS t|tjtj fƒrv|jS t|tj!ƒr|j"S t|tj#ƒrˆ|j$S dS )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Úparticipantr+   Únew_banned_rightsÚ"ChannelAdminLogEventActionStopPollr*   Ú(ChannelAdminLogEventActionStartGroupCallr.   Ú)ChannelAdminLogEventActionParticipantMuteÚ+ChannelAdminLogEventActionParticipantUnmuteÚ0ChannelAdminLogEventActionToggleGroupCallSettingÚ
join_mutedr3   Ú
new_inviter5   r   r   r   Únewj   sX   ø
þþþÿzAdminLogEvent.newc                 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   r   r   r   Úchanged_about›   ó   ÿzAdminLogEvent.changed_aboutc                 C   rH   )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   r   r   r   Úchanged_title¥   rJ   zAdminLogEvent.changed_titlec                 C   rH   )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   r   r   r   Úchanged_username¯   rJ   zAdminLogEvent.changed_usernamec                 C   rH   )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   r   r   r   Úchanged_photo¹   rJ   zAdminLogEvent.changed_photoc                 C   rH   )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   r   r   r   Úchanged_sticker_setÃ   rJ   z!AdminLogEvent.changed_sticker_setc                 C   rH   )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   r   r   r   Úchanged_messageÍ   ó   ÿzAdminLogEvent.changed_messagec                 C   rH   )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   r   r   r   Údeleted_messageØ   rP   zAdminLogEvent.deleted_messagec                 C   rH   )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   r   r   r   Úchanged_adminã   s   	þzAdminLogEvent.changed_adminc                 C   rH   )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   r   r   r   Úchanged_restrictionsð   s   þz"AdminLogEvent.changed_restrictionsc                 C   rH   )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   r   r   r   Úchanged_invitesü   rJ   zAdminLogEvent.changed_invitesc                 C   rH   )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   r   r   r   Úchanged_location  rJ   zAdminLogEvent.changed_locationc                 C   rH   )z]
        Whether `user` joined through the channel's
        public username or not.
        )r   r   r   r   Ú)ChannelAdminLogEventActionParticipantJoinr   r   r   r   Újoined  s   ÿzAdminLogEvent.joinedc                 C   rH   )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   r<   r   r   r   r   Újoined_invite  s   	ÿzAdminLogEvent.joined_invitec                 C   rH   )z9
        Whether `user` left the channel or not.
        )r   r   r   r   Ú*ChannelAdminLogEventActionParticipantLeaver   r   r   r   Úleft%  s   ÿzAdminLogEvent.leftc                 C   rH   )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   r   r   r   Úchanged_hide_history-  rP   z"AdminLogEvent.changed_hide_historyc                 C   rH   )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   r   r   r   Úchanged_signatures8  rP   z AdminLogEvent.changed_signaturesc                 C   rH   )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   r   r   r   Úchanged_pinC  rP   zAdminLogEvent.changed_pinc                 C   rH   )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   r+   r   r   r   r   Úchanged_default_banned_rightsN  rP   z+AdminLogEvent.changed_default_banned_rightsc                 C   rH   )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   r@   r   r   r   r   Ústopped_pollY  rP   zAdminLogEvent.stopped_pollc                 C   rH   )z}
        Whether a group call was started or not.

        If `True`, `new` will be present as :tl:`InputGroupCall`.
        )r   r   r   r   rA   r   r   r   r   Ústarted_group_calld  rJ   z AdminLogEvent.started_group_callc                 C   rH   )z}
        Whether a group call was started or not.

        If `True`, `old` will be present as :tl:`InputGroupCall`.
        )r   r   r   r   r-   r   r   r   r   Údiscarded_group_calln  rJ   z"AdminLogEvent.discarded_group_callc                 C   rH   )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   rB   r   r   r   r   Ú
user_mutedx  rJ   zAdminLogEvent.user_mutedc                 C   rH   )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   rC   r   r   r   r   Úuser_unmutted‚  rJ   zAdminLogEvent.user_unmuttedc                 C   rH   )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   rD   r   r   r   r   Úchanged_call_settingsŒ  rJ   z#AdminLogEvent.changed_call_settingsc                 C   rH   )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   r   r   r   Úchanged_history_ttl–  s   
ÿz!AdminLogEvent.changed_history_ttlc                 C   rH   )zŒ
        Whether the exported chat invite has been deleted.

        If `True`, `old` will be the deleted :tl:`ExportedChatInvite`.
        )r   r   r   r   r/   r   r   r   r   Údeleted_exported_invite£  rJ   z%AdminLogEvent.deleted_exported_invitec                 C   rH   )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   r3   r   r   r   r   Úedited_exported_invite­  rP   z$AdminLogEvent.edited_exported_invitec                 C   rH   )zŒ
        Whether the exported chat invite has been revoked.

        If `True`, `old` will be the revoked :tl:`ExportedChatInvite`.
        )r   r   r   r   r0   r   r   r   r   Úrevoked_exported_invite¸  rJ   z%AdminLogEvent.revoked_exported_invitec                 C   rH   )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   r1   r   r   r   r   Újoined_by_inviteÂ  rP   zAdminLogEvent.joined_by_invitec                 C   rH   )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   r=   r   r   r   r   Úchanged_user_volumeÍ  rJ   z!AdminLogEvent.changed_user_volumec                 C   s
   t | jƒS r   )Ústrr   r   r   r   r   Ú__str__×  ó   
zAdminLogEvent.__str__c                 C   s
   | j  ¡ S r   )r   Ú	stringifyr   r   r   r   ro   Ú  rn   zAdminLogEvent.stringifyN),Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r   r   r   r7   rG   rI   rK   rL   rM   rN   rO   rQ   rR   rS   rT   rU   rW   rX   rZ   r[   r\   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rm   ro   r   r   r   r   r      sš    




-
0
	
	
	
	
	






	
	













	
	
	
	
	

	


	


	r   N)Útlr   Úutilsr   r   r   r   r   r   Ú<module>   s    