From bb9d1f895f3631aa17effc064fbb7b4389d999df Mon Sep 17 00:00:00 2001 From: luckydonald Date: Sun, 8 Nov 2020 12:59:18 +0100 Subject: [PATCH] Actually set the `photo_type` from the given `file_id` if we have that information. --- telethon/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telethon/utils.py b/telethon/utils.py index aef75bb6..8d90a679 100644 --- a/telethon/utils.py +++ b/telethon/utils.py @@ -1158,6 +1158,9 @@ def resolve_bot_file_id(file_id): file: PhotoFileId photo_type = 's' if file.id or file.access_hash else 'x' + if isinstance(file.photosize, PhotoFileId.PhotosizeSourceThumbnail) and file.photosize.thumbnail_type: + photo_type = file.photosize.thumbnail_type.encode() + # end if foto_size = file.photosize if isinstance(foto_size, (PhotoFileId.PhotosizeSourceLegacy, PhotoFileId.PhotosizeSourceThumbnail, PhotoFileId.PhotosizeSourceDialogPhotoSmall, PhotoFileId.PhotosizeSourceDialogPhotoBig, PhotoFileId.PhotosizeSourceStickersetThumbnail)):