mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 04:52:30 +00:00
Update to layer 129 and other additions/enhancements (#3074)
* Apply code corrections for the new layer types. * Support not passing `user` to `get_permissions`. * `download_profile_photo` now supports `MessageService`. * `thumb` in send and edit message. * Document new known errors.
This commit is contained in:
@@ -271,11 +271,9 @@ class DownloadMethods:
|
||||
|
||||
if isinstance(photo, (types.UserProfilePhoto, types.ChatPhoto)):
|
||||
dc_id = photo.dc_id
|
||||
which = photo.photo_big if download_big else photo.photo_small
|
||||
loc = types.InputPeerPhotoFileLocation(
|
||||
peer=await self.get_input_entity(entity),
|
||||
local_id=which.local_id,
|
||||
volume_id=which.volume_id,
|
||||
photo_id=photo.photo_id,
|
||||
big=download_big
|
||||
)
|
||||
else:
|
||||
@@ -400,6 +398,11 @@ class DownloadMethods:
|
||||
if isinstance(media, str):
|
||||
media = utils.resolve_bot_file_id(media)
|
||||
|
||||
if isinstance(media, types.MessageService):
|
||||
if isinstance(message.action,
|
||||
types.MessageActionChatEditPhoto):
|
||||
media = media.photo
|
||||
|
||||
if isinstance(media, types.MessageMediaWebPage):
|
||||
if isinstance(media.webpage, types.WebPage):
|
||||
media = media.webpage.document or media.webpage.photo
|
||||
|
Reference in New Issue
Block a user