From 401de913af8bd19e88de0c78b027f7750b15a73f Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 9 Oct 2017 10:59:15 +0200 Subject: [PATCH] Fix EntityDatabase failing with InputPeer keys --- telethon/tl/entity_database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/tl/entity_database.py b/telethon/tl/entity_database.py index 61c07efc..00284409 100644 --- a/telethon/tl/entity_database.py +++ b/telethon/tl/entity_database.py @@ -148,8 +148,8 @@ class EntityDatabase: if isinstance(key, TLObject): sc = type(key).SUBCLASS_OF_ID - if sc == 0x2d45687: - # Subclass of "Peer" + if sc in {0x2d45687, 0xc91c90b6}: + # Subclass of "Peer" or "InputPeer" return self._entities[utils.get_peer_id(key, add_mark=True)] elif sc in {0x2da17977, 0xc5af5d94, 0x6d44b7db}: # Subclass of "User", "Chat" or "Channel"