Fix telegram bot send_document (#118616)

This commit is contained in:
Luca Angemi 2024-06-02 08:32:24 +02:00 committed by Paulus Schoutsen
parent 236b19c5b3
commit 1d1af7ec11

View File

@ -287,7 +287,9 @@ SERVICE_MAP = {
def _read_file_as_bytesio(file_path: str) -> io.BytesIO:
"""Read a file and return it as a BytesIO object."""
with open(file_path, "rb") as file:
return io.BytesIO(file.read())
data = io.BytesIO(file.read())
data.name = file_path
return data
async def load_data(