From 0dfe373c889d0d150fe46f50e6fe875e99ba1c8d Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 28 Jun 2018 19:13:47 +0200 Subject: [PATCH] Make Photo work in download_media --- pyrogram/client/methods/download_media.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/methods/download_media.py b/pyrogram/client/methods/download_media.py index 5eb04fbc..89b0f61d 100644 --- a/pyrogram/client/methods/download_media.py +++ b/pyrogram/client/methods/download_media.py @@ -77,7 +77,7 @@ class DownloadMedia(BaseClient): """ if isinstance(message, pyrogram_types.Message): if message.photo: - media = message.photo[-1] + media = message.photo.sizes[-1] elif message.audio: media = message.audio elif message.document: @@ -95,7 +95,7 @@ class DownloadMedia(BaseClient): else: return elif isinstance(message, ( - pyrogram_types.PhotoSize, + pyrogram_types.Photo, pyrogram_types.Audio, pyrogram_types.Document, pyrogram_types.Video,