mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 10:53:44 +03:00
Fix ChatAction for groups with hidden members
This commit is contained in:
parent
07a7a8b404
commit
4de1609d4e
|
@ -108,6 +108,17 @@ class ChatAction(EventBuilder):
|
||||||
return cls.Event(msg,
|
return cls.Event(msg,
|
||||||
new_score=action.score)
|
new_score=action.score)
|
||||||
|
|
||||||
|
elif isinstance(update, types.UpdateChannelParticipant) \
|
||||||
|
and bool(update.new_participant) != bool(update.prev_participant):
|
||||||
|
# If members are hidden, bots will receive this update instead,
|
||||||
|
# as there won't be a service message. Promotions and demotions
|
||||||
|
# seem to have both new and prev participant, which are ignored
|
||||||
|
# by this event.
|
||||||
|
return cls.Event(types.PeerChannel(update.channel_id),
|
||||||
|
users=update.user_id,
|
||||||
|
added_by=update.actor_id if update.new_participant else None,
|
||||||
|
kicked_by=update.actor_id if update.prev_participant else None)
|
||||||
|
|
||||||
class Event(EventCommon):
|
class Event(EventCommon):
|
||||||
"""
|
"""
|
||||||
Represents the event of a new chat action.
|
Represents the event of a new chat action.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user