mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Add progress_callback to download_profile_photo
This commit is contained in:
@@ -1628,7 +1628,8 @@ class TelegramClient:
|
||||
entity: 'hints.EntityLike',
|
||||
file: 'hints.FileLike' = None,
|
||||
*,
|
||||
thumb: typing.Union[str, enums.Size] = ()) -> typing.Optional[str]:
|
||||
thumb: typing.Union[str, enums.Size] = (),
|
||||
progress_callback: 'hints.ProgressCallback' = None) -> typing.Optional[str]:
|
||||
"""
|
||||
Downloads the profile photo from the given user, chat or channel.
|
||||
|
||||
@@ -1662,6 +1663,10 @@ class TelegramClient:
|
||||
|
||||
By default, the largest size (original) is downloaded.
|
||||
|
||||
progress_callback (`callable`, optional):
|
||||
A callback function accepting two parameters:
|
||||
``(received bytes, total)``.
|
||||
|
||||
Returns
|
||||
`None` if no photo was provided, or if it was Empty. On success
|
||||
the file path is returned since it may differ from the one given.
|
||||
|
Reference in New Issue
Block a user