diff --git a/telethon/sessions/memory.py b/telethon/sessions/memory.py index 2bc973aa..c18bf51d 100644 --- a/telethon/sessions/memory.py +++ b/telethon/sessions/memory.py @@ -228,7 +228,7 @@ class MemorySession(Session): def cache_file(self, md5_digest, file_size, instance): if not isinstance(instance, (InputDocument, InputPhoto)): raise TypeError('Cannot cache %s instance' % type(instance)) - key = (md5_digest, file_size, _SentFileType.from_type(instance)) + key = (md5_digest, file_size, _SentFileType.from_type(type(instance))) value = (instance.id, instance.access_hash) self._files[key] = value