From e28fbc66782b31ed4d2cd21e32afeace2f9f1d9c Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 7 Oct 2020 10:39:02 +0200 Subject: [PATCH] Fix ChatAction check for self-user joining a chat --- telethon/events/chataction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/events/chataction.py b/telethon/events/chataction.py index 9a336e38..e1b541f0 100644 --- a/telethon/events/chataction.py +++ b/telethon/events/chataction.py @@ -77,8 +77,8 @@ class ChatAction(EventBuilder): added_by=True, users=msg.from_id) elif isinstance(action, types.MessageActionChatAddUser): - # If a user adds itself, it means they joined - added_by = ([utils.get_peer_id(msg.from_id)] == action.users) or msg.from_id + # If a user adds itself, it means they joined via the public chat username + added_by = ([msg.sender_id] == action.users) or msg.from_id return cls.Event(msg, added_by=added_by, users=action.users)