From 1d0ad9628da41ba62ad55dd11f2ef3ab9f5b27da Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 23 Aug 2017 00:55:34 +0200 Subject: [PATCH] Rename "callback" to "progress_callback" for consistency --- telethon/telegram_client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index e661130f..9fc2e4b2 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -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)