mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 12:57:52 +00:00
Update download_media docstrings
This commit is contained in:
parent
e48ad9a7dd
commit
d9b3d67126
@ -3022,8 +3022,9 @@ class Client:
|
|||||||
"""Use this method to download the media from a Message.
|
"""Use this method to download the media from a Message.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
message (:obj:`Message <pyrogram.api.types.pyrogram.Message>`):
|
message (:obj:`Message <pyrogram.api.types.pyrogram.Message>` | ``str``):
|
||||||
The Message containing the media.
|
Pass a Message containing the media, the media itself (message.audio, message.video, ...) or
|
||||||
|
the file id as string.
|
||||||
|
|
||||||
file_name (``str``, optional):
|
file_name (``str``, optional):
|
||||||
A custom *file_name* to be used instead of the one provided by Telegram.
|
A custom *file_name* to be used instead of the one provided by Telegram.
|
||||||
@ -3038,6 +3039,7 @@ class Client:
|
|||||||
progress (``callable``):
|
progress (``callable``):
|
||||||
Pass a callback function to view the download progress.
|
Pass a callback function to view the download progress.
|
||||||
The function must accept two arguments (current, total).
|
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:
|
Other Parameters:
|
||||||
current (``int``):
|
current (``int``):
|
||||||
@ -3079,6 +3081,11 @@ class Client:
|
|||||||
pyrogram.Sticker
|
pyrogram.Sticker
|
||||||
)):
|
)):
|
||||||
media = message
|
media = message
|
||||||
|
elif isinstance(message, str):
|
||||||
|
media = pyrogram.Document(
|
||||||
|
file_id=message,
|
||||||
|
file_size=0
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user