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.
This commit is contained in:
Lonami Exo 2018-01-04 15:33:48 +01:00
parent 32505b905f
commit 4fba27dee9

View File

@ -624,6 +624,9 @@ class TelegramBareClient:
part_size_kb = get_appropriated_part_size(file_size) part_size_kb = get_appropriated_part_size(file_size)
file_name = os.path.basename(file_path) file_name = os.path.basename(file_path)
""" """
if isinstance(file, (InputFile, InputFileBig)):
return file # Already uploaded
if isinstance(file, str): if isinstance(file, str):
file_size = os.path.getsize(file) file_size = os.path.getsize(file)
elif isinstance(file, bytes): elif isinstance(file, bytes):