From 4fba27dee9a6fdb31b85567f97582bbcd629bb00 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 4 Jan 2018 15:33:48 +0100 Subject: [PATCH] Accept InputFile/InputFileBig on .upload_file for 2c437c51 Now an input file thumbnail can also be specified, instead needing to reupload the file every time. --- telethon/telegram_bare_client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telethon/telegram_bare_client.py b/telethon/telegram_bare_client.py index 036aafd2..28bd3334 100644 --- a/telethon/telegram_bare_client.py +++ b/telethon/telegram_bare_client.py @@ -624,6 +624,9 @@ class TelegramBareClient: part_size_kb = get_appropriated_part_size(file_size) file_name = os.path.basename(file_path) """ + if isinstance(file, (InputFile, InputFileBig)): + return file # Already uploaded + if isinstance(file, str): file_size = os.path.getsize(file) elif isinstance(file, bytes):