2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Make Photo work in download_media

This commit is contained in:
Dan 2018-06-28 19:13:47 +02:00
parent fbf69fb8bd
commit 0dfe373c88

View File

@ -77,7 +77,7 @@ class DownloadMedia(BaseClient):
""" """
if isinstance(message, pyrogram_types.Message): if isinstance(message, pyrogram_types.Message):
if message.photo: if message.photo:
media = message.photo[-1] media = message.photo.sizes[-1]
elif message.audio: elif message.audio:
media = message.audio media = message.audio
elif message.document: elif message.document:
@ -95,7 +95,7 @@ class DownloadMedia(BaseClient):
else: else:
return return
elif isinstance(message, ( elif isinstance(message, (
pyrogram_types.PhotoSize, pyrogram_types.Photo,
pyrogram_types.Audio, pyrogram_types.Audio,
pyrogram_types.Document, pyrogram_types.Document,
pyrogram_types.Video, pyrogram_types.Video,