From c12c65f728b9cbc1517776c6da73d66e56bc6615 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 1 May 2019 12:49:36 +0200 Subject: [PATCH] Let utils.get_peer handle DialogPeer This is important since some updates have a peer of that type instead of just the normal Peer instance. --- telethon/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telethon/utils.py b/telethon/utils.py index 6f2faf3b..d6df6b85 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -771,6 +771,8 @@ def get_peer(peer): return peer.peer elif isinstance(peer, types.ChannelFull): return types.PeerChannel(peer.id) + elif isinstance(peer, types.DialogPeer): + return peer.peer if peer.SUBCLASS_OF_ID in (0x7d7c6f86, 0xd9c7fc18): # ChatParticipant, ChannelParticipant