From d9b3d671266a51f95a899ede2e19bd42f330795f Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 16 Apr 2018 11:44:05 +0200 Subject: [PATCH] Update download_media docstrings --- pyrogram/client/client.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 330940d7..cb3c30d6 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -3022,8 +3022,9 @@ class Client: """Use this method to download the media from a Message. Args: - message (:obj:`Message `): - The Message containing the media. + message (:obj:`Message ` | ``str``): + Pass a Message containing the media, the media itself (message.audio, message.video, ...) or + the file id as string. file_name (``str``, optional): A custom *file_name* to be used instead of the one provided by Telegram. @@ -3038,6 +3039,7 @@ class Client: progress (``callable``): Pass a callback function to view the download progress. The function must accept two arguments (current, total). + Note that this will not work in case you are downloading a media using a *file_id*. Other Parameters: current (``int``): @@ -3079,6 +3081,11 @@ class Client: pyrogram.Sticker )): media = message + elif isinstance(message, str): + media = pyrogram.Document( + file_id=message, + file_size=0 + ) else: return