mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Rename "callback" to "progress_callback" for consistency
This commit is contained in:
parent
fd6a9a4318
commit
1d0ad9628d
|
@ -479,7 +479,7 @@ class TelegramClient(TelegramBareClient):
|
|||
# region Uploading files
|
||||
|
||||
def send_file(self, entity, file, caption='',
|
||||
force_document=False, callback=None):
|
||||
force_document=False, progress_callback=None):
|
||||
"""Sends a file to the specified entity.
|
||||
The file may either be a path, a byte array, or a stream.
|
||||
|
||||
|
@ -511,8 +511,9 @@ class TelegramClient(TelegramBareClient):
|
|||
if file_hash in self._upload_cache:
|
||||
file_handle = self._upload_cache[file_hash]
|
||||
else:
|
||||
file_handle = self.upload_file(file, progress_callback=callback)
|
||||
self._upload_cache[file_hash] = file_handle
|
||||
self._upload_cache[file_hash] = file_handle = self.upload_file(
|
||||
file, progress_callback=progress_callback
|
||||
)
|
||||
|
||||
if as_photo and not force_document:
|
||||
media = InputMediaUploadedPhoto(file_handle, caption)
|
||||
|
|
Loading…
Reference in New Issue
Block a user