From 85700b0ffc191458677b6d29452cff121a5d4d13 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Fri, 1 Mar 2019 21:23:53 +0300 Subject: [PATCH] Do not cache entities without access_hash --- pyrogram/client/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 2bcf294f..33b3f137 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -762,6 +762,8 @@ class Client(Methods, BaseClient): types.Chat, types.ChatForbidden, types.Channel, types.ChannelForbidden]]): for entity in entities: + if isinstance(entity, (types.User, types.Channel, types.ChannelForbidden)) and not entity.access_hash: + continue self.session_storage.cache_peer(entity) def download_worker(self):