diff --git a/ubot/fixes/fast_telethon.py b/ubot/fixes/fast_telethon.py index e7865fa..a0ae276 100644 --- a/ubot/fixes/fast_telethon.py +++ b/ubot/fixes/fast_telethon.py @@ -33,12 +33,7 @@ TypeLocation = Union[Document, InputDocumentFileLocation, InputPeerPhotoFileLoca def stream_file(file_to_stream: BinaryIO, chunk_size=1024): - while True: - data_read = file_to_stream.read(chunk_size) - - if not data_read: - break - + while data_read := file_to_stream.read(chunk_size): yield data_read