2019-01-03 15:09:59 +03:00
|
|
|
from ...tl import types
|
|
|
|
from ...utils import get_input_peer
|
|
|
|
|
|
|
|
|
|
|
|
class AdminLogEvent:
|
|
|
|
"""
|
|
|
|
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`.
|
|
|
|
"""
|
|
|
|
def __init__(self, original, entities):
|
|
|
|
self.original = original
|
|
|
|
self.entities = entities
|
|
|
|
self.user = entities[original.user_id]
|
|
|
|
self.input_user = get_input_peer(self.user)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def id(self):
|
|
|
|
"""
|
|
|
|
The ID of this event.
|
|
|
|
"""
|
|
|
|
return self.original.id
|
|
|
|
|
|
|
|
@property
|
|
|
|
def date(self):
|
|
|
|
"""
|
2019-11-10 13:29:43 +03:00
|
|
|
The date when this event occurred.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
|
|
|
return self.original.date
|
|
|
|
|
|
|
|
@property
|
|
|
|
def user_id(self):
|
|
|
|
"""
|
|
|
|
The ID of the user that triggered this event.
|
|
|
|
"""
|
|
|
|
return self.original.user_id
|
|
|
|
|
|
|
|
@property
|
|
|
|
def action(self):
|
|
|
|
"""
|
|
|
|
The original :tl:`ChannelAdminLogEventAction`.
|
|
|
|
"""
|
|
|
|
return self.original.action
|
|
|
|
|
|
|
|
@property
|
|
|
|
def old(self):
|
|
|
|
"""
|
|
|
|
The old value from the event.
|
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
ori = self.original.action
|
2019-01-03 15:09:59 +03:00
|
|
|
if isinstance(ori, (
|
|
|
|
types.ChannelAdminLogEventActionChangeAbout,
|
|
|
|
types.ChannelAdminLogEventActionChangeTitle,
|
2019-06-23 22:23:40 +03:00
|
|
|
types.ChannelAdminLogEventActionChangeUsername,
|
2021-02-23 22:10:51 +03:00
|
|
|
types.ChannelAdminLogEventActionChangeLocation,
|
|
|
|
types.ChannelAdminLogEventActionChangeHistoryTTL,
|
2019-01-03 15:09:59 +03:00
|
|
|
)):
|
|
|
|
return ori.prev_value
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionChangePhoto):
|
|
|
|
return ori.prev_photo
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionChangeStickerSet):
|
|
|
|
return ori.prev_stickerset
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionEditMessage):
|
|
|
|
return ori.prev_message
|
|
|
|
elif isinstance(ori, (
|
|
|
|
types.ChannelAdminLogEventActionParticipantToggleAdmin,
|
|
|
|
types.ChannelAdminLogEventActionParticipantToggleBan
|
|
|
|
)):
|
|
|
|
return ori.prev_participant
|
|
|
|
elif isinstance(ori, (
|
|
|
|
types.ChannelAdminLogEventActionToggleInvites,
|
|
|
|
types.ChannelAdminLogEventActionTogglePreHistoryHidden,
|
|
|
|
types.ChannelAdminLogEventActionToggleSignatures
|
|
|
|
)):
|
|
|
|
return not ori.new_value
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionDeleteMessage):
|
|
|
|
return ori.message
|
2019-01-21 22:09:13 +03:00
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionDefaultBannedRights):
|
|
|
|
return ori.prev_banned_rights
|
2020-12-11 18:55:49 +03:00
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionDiscardGroupCall):
|
|
|
|
return ori.call
|
2021-02-23 22:10:51 +03:00
|
|
|
elif isinstance(ori, (
|
|
|
|
types.ChannelAdminLogEventActionExportedInviteDelete,
|
|
|
|
types.ChannelAdminLogEventActionExportedInviteRevoke,
|
|
|
|
types.ChannelAdminLogEventActionParticipantJoinByInvite,
|
|
|
|
)):
|
|
|
|
return ori.invite
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionExportedInviteEdit):
|
|
|
|
return ori.prev_invite
|
2019-01-03 15:09:59 +03:00
|
|
|
|
|
|
|
@property
|
|
|
|
def new(self):
|
|
|
|
"""
|
|
|
|
The new value present in the event.
|
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
ori = self.original.action
|
2019-01-03 15:09:59 +03:00
|
|
|
if isinstance(ori, (
|
|
|
|
types.ChannelAdminLogEventActionChangeAbout,
|
|
|
|
types.ChannelAdminLogEventActionChangeTitle,
|
|
|
|
types.ChannelAdminLogEventActionChangeUsername,
|
|
|
|
types.ChannelAdminLogEventActionToggleInvites,
|
|
|
|
types.ChannelAdminLogEventActionTogglePreHistoryHidden,
|
2019-06-23 22:23:40 +03:00
|
|
|
types.ChannelAdminLogEventActionToggleSignatures,
|
2021-02-23 22:10:51 +03:00
|
|
|
types.ChannelAdminLogEventActionChangeLocation,
|
|
|
|
types.ChannelAdminLogEventActionChangeHistoryTTL,
|
2019-01-03 15:09:59 +03:00
|
|
|
)):
|
|
|
|
return ori.new_value
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionChangePhoto):
|
|
|
|
return ori.new_photo
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionChangeStickerSet):
|
|
|
|
return ori.new_stickerset
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionEditMessage):
|
|
|
|
return ori.new_message
|
|
|
|
elif isinstance(ori, (
|
|
|
|
types.ChannelAdminLogEventActionParticipantToggleAdmin,
|
|
|
|
types.ChannelAdminLogEventActionParticipantToggleBan
|
|
|
|
)):
|
|
|
|
return ori.new_participant
|
2021-02-23 22:10:51 +03:00
|
|
|
elif isinstance(ori, (
|
|
|
|
types.ChannelAdminLogEventActionParticipantInvite,
|
|
|
|
types.ChannelAdminLogEventActionParticipantVolume,
|
|
|
|
)):
|
2019-01-03 15:09:59 +03:00
|
|
|
return ori.participant
|
2019-01-21 22:09:13 +03:00
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionDefaultBannedRights):
|
|
|
|
return ori.new_banned_rights
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionStopPoll):
|
|
|
|
return ori.message
|
2020-12-11 18:55:49 +03:00
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionStartGroupCall):
|
|
|
|
return ori.call
|
|
|
|
elif isinstance(ori, (
|
|
|
|
types.ChannelAdminLogEventActionParticipantMute,
|
|
|
|
types.ChannelAdminLogEventActionParticipantUnmute,
|
|
|
|
)):
|
|
|
|
return ori.participant
|
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionToggleGroupCallSetting):
|
|
|
|
return ori.join_muted
|
2021-02-23 22:10:51 +03:00
|
|
|
elif isinstance(ori, types.ChannelAdminLogEventActionExportedInviteEdit):
|
|
|
|
return ori.new_invite
|
2019-01-03 15:09:59 +03:00
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_about(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether the channel's about was changed or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as `str`.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionChangeAbout)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_title(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether the channel's title was changed or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as `str`.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionChangeTitle)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_username(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether the channel's username was changed or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as `str`.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionChangeUsername)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_photo(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether the channel's photo was changed or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as :tl:`Photo`.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionChangePhoto)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_sticker_set(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether the channel's sticker set was changed or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as :tl:`InputStickerSet`.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionChangeStickerSet)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_message(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether a message in this channel was edited or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as
|
2019-01-03 15:09:59 +03:00
|
|
|
`Message <telethon.tl.custom.message.Message>`.
|
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionEditMessage)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def deleted_message(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether a message in this channel was deleted or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` will be present as
|
2019-01-03 15:09:59 +03:00
|
|
|
`Message <telethon.tl.custom.message.Message>`.
|
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionDeleteMessage)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_admin(self):
|
|
|
|
"""
|
|
|
|
Whether the permissions for an admin in this channel
|
2019-05-07 22:25:55 +03:00
|
|
|
changed or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as
|
2019-01-03 15:09:59 +03:00
|
|
|
:tl:`ChannelParticipant`.
|
|
|
|
"""
|
|
|
|
return isinstance(
|
2019-01-04 00:25:50 +03:00
|
|
|
self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionParticipantToggleAdmin)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_restrictions(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether a message in this channel was edited or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as
|
2019-01-03 15:09:59 +03:00
|
|
|
:tl:`ChannelParticipant`.
|
|
|
|
"""
|
|
|
|
return isinstance(
|
2019-01-04 00:25:50 +03:00
|
|
|
self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionParticipantToggleBan)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_invites(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether the invites in the channel were toggled or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as `bool`.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionToggleInvites)
|
|
|
|
|
2019-06-23 22:23:40 +03:00
|
|
|
@property
|
|
|
|
def changed_location(self):
|
|
|
|
"""
|
|
|
|
Whether the location setting of the channel has changed or not.
|
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as :tl:`ChannelLocation`.
|
2019-06-23 22:23:40 +03:00
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionChangeLocation)
|
|
|
|
|
2019-01-03 15:09:59 +03:00
|
|
|
@property
|
|
|
|
def joined(self):
|
|
|
|
"""
|
|
|
|
Whether `user` joined through the channel's
|
2019-05-07 22:25:55 +03:00
|
|
|
public username or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionParticipantJoin)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def joined_invite(self):
|
|
|
|
"""
|
|
|
|
Whether a new user joined through an invite
|
2019-05-07 22:25:55 +03:00
|
|
|
link to the channel or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `new` will be present as
|
2019-01-03 15:09:59 +03:00
|
|
|
:tl:`ChannelParticipant`.
|
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionParticipantInvite)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def left(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether `user` left the channel or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionParticipantLeave)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_hide_history(self):
|
|
|
|
"""
|
|
|
|
Whether hiding the previous message history for new members
|
2019-05-07 22:25:55 +03:00
|
|
|
in the channel was toggled or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as `bool`.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionTogglePreHistoryHidden)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_signatures(self):
|
|
|
|
"""
|
|
|
|
Whether the message signatures in the channel were toggled
|
2019-05-07 22:25:55 +03:00
|
|
|
or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will be present as `bool`.
|
2019-01-03 15:09:59 +03:00
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionToggleSignatures)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_pin(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether a new message in this channel was pinned or not.
|
2019-01-03 15:09:59 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `new` will be present as
|
2019-01-03 15:09:59 +03:00
|
|
|
`Message <telethon.tl.custom.message.Message>`.
|
|
|
|
"""
|
2019-01-04 00:25:50 +03:00
|
|
|
return isinstance(self.original.action,
|
2019-01-03 15:09:59 +03:00
|
|
|
types.ChannelAdminLogEventActionUpdatePinned)
|
|
|
|
|
2019-01-21 22:09:13 +03:00
|
|
|
@property
|
|
|
|
def changed_default_banned_rights(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether the default banned rights were changed or not.
|
2019-01-21 22:09:13 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `old` and `new` will
|
2019-01-21 22:09:13 +03:00
|
|
|
be present as :tl:`ChatBannedRights`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionDefaultBannedRights)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def stopped_poll(self):
|
|
|
|
"""
|
2019-05-07 22:25:55 +03:00
|
|
|
Whether a poll was stopped or not.
|
2019-01-21 22:09:13 +03:00
|
|
|
|
2019-07-06 13:10:25 +03:00
|
|
|
If `True`, `new` will be present as
|
2019-01-21 22:09:13 +03:00
|
|
|
`Message <telethon.tl.custom.message.Message>`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionStopPoll)
|
|
|
|
|
2020-12-11 18:55:49 +03:00
|
|
|
@property
|
|
|
|
def started_group_call(self):
|
|
|
|
"""
|
|
|
|
Whether a group call was started or not.
|
|
|
|
|
|
|
|
If `True`, `new` will be present as :tl:`InputGroupCall`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionStartGroupCall)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def discarded_group_call(self):
|
|
|
|
"""
|
|
|
|
Whether a group call was started or not.
|
|
|
|
|
|
|
|
If `True`, `old` will be present as :tl:`InputGroupCall`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionDiscardGroupCall)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def user_muted(self):
|
|
|
|
"""
|
|
|
|
Whether a participant was muted in the ongoing group call or not.
|
|
|
|
|
|
|
|
If `True`, `new` will be present as :tl:`GroupCallParticipant`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionParticipantMute)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def user_unmutted(self):
|
|
|
|
"""
|
|
|
|
Whether a participant was unmuted from the ongoing group call or not.
|
|
|
|
|
|
|
|
If `True`, `new` will be present as :tl:`GroupCallParticipant`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionParticipantUnmute)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_call_settings(self):
|
|
|
|
"""
|
|
|
|
Whether the group call settings were changed or not.
|
|
|
|
|
|
|
|
If `True`, `new` will be `True` if new users are muted on join.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionToggleGroupCallSetting)
|
|
|
|
|
2021-02-23 22:10:51 +03:00
|
|
|
@property
|
|
|
|
def changed_history_ttl(self):
|
|
|
|
"""
|
|
|
|
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.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionChangeHistoryTTL)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def deleted_exported_invite(self):
|
|
|
|
"""
|
|
|
|
Whether the exported chat invite has been deleted.
|
|
|
|
|
|
|
|
If `True`, `old` will be the deleted :tl:`ExportedChatInvite`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionExportedInviteDelete)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def edited_exported_invite(self):
|
|
|
|
"""
|
|
|
|
Whether the exported chat invite has been edited.
|
|
|
|
|
|
|
|
If `True`, `old` and `new` will be the old and new
|
|
|
|
:tl:`ExportedChatInvite`, respectively.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionExportedInviteEdit)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def revoked_exported_invite(self):
|
|
|
|
"""
|
|
|
|
Whether the exported chat invite has been revoked.
|
|
|
|
|
|
|
|
If `True`, `old` will be the revoked :tl:`ExportedChatInvite`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionExportedInviteRevoke)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def joined_by_invite(self):
|
|
|
|
"""
|
|
|
|
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.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionParticipantJoinByInvite)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def changed_user_volume(self):
|
|
|
|
"""
|
|
|
|
Whether a participant's volume in a call has been changed.
|
|
|
|
|
|
|
|
If `True`, `new` will be the updated :tl:`GroupCallParticipant`.
|
|
|
|
"""
|
|
|
|
return isinstance(self.original.action,
|
|
|
|
types.ChannelAdminLogEventActionParticipantVolume)
|
|
|
|
|
2019-01-03 15:09:59 +03:00
|
|
|
def __str__(self):
|
|
|
|
return str(self.original)
|
|
|
|
|
|
|
|
def stringify(self):
|
|
|
|
return self.original.stringify()
|