Update and clarify some docs

cc #1388, #1396
This commit is contained in:
Lonami Exo
2020-02-28 11:50:16 +01:00
parent e451abbf20
commit 1ec38aa5b2
5 changed files with 27 additions and 3 deletions

View File

@@ -328,6 +328,13 @@ class DownloadMethods:
# or
path = await message.download_media()
await message.download_media(filename)
# Printing download progress
def callback(current, total):
print('Downloaded', current, 'out of', total,
'bytes: {:.2%}'.format(current / total))
await client.download_media(message, progress_callback=callback)
"""
# TODO This won't work for messageService
if isinstance(message, types.Message):
@@ -373,6 +380,11 @@ class DownloadMethods:
"""
Low-level method to download files from their input location.
.. note::
Generally, you should instead use `download_media`.
This method is intended to be a bit more low-level.
Arguments
input_location (:tl:`InputFileLocation`):
The file location from which the file will be downloaded.