From c924365e244ef32a39f121bdd7453517f3422227 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 13 Nov 2020 10:52:24 +0100 Subject: [PATCH] Handle ChatEmpty in utils.get_peer --- telethon/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telethon/utils.py b/telethon/utils.py index a5f95e9a..866a4972 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -948,6 +948,8 @@ def get_peer(peer): return types.PeerChannel(peer.id) elif isinstance(peer, types.UserEmpty): return types.PeerUser(peer.id) + elif isinstance(peer, types.ChatEmpty): + return types.PeerChat(peer.id) if peer.SUBCLASS_OF_ID in (0x7d7c6f86, 0xd9c7fc18): # ChatParticipant, ChannelParticipant