From c95467ea3e99a1bd953c2eb10af47879a16a6bc0 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 31 Mar 2019 12:07:29 +0200 Subject: [PATCH] Fix ._chat_peer could be None in Event.filter() --- telethon/events/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telethon/events/common.py b/telethon/events/common.py index 7940a94a..45032207 100644 --- a/telethon/events/common.py +++ b/telethon/events/common.py @@ -108,7 +108,8 @@ class EventBuilder(abc.ABC): return None if self.chats is not None: - inside = utils.get_peer_id(event._chat_peer) in self.chats + # Note: the `event.chat_id` property checks if it's `None` for us + inside = event.chat_id in self.chats if inside == self.blacklist_chats: # If this chat matches but it's a blacklist ignore. # If it doesn't match but it's a whitelist ignore.