From 87142b3654b5cc97ae3f6eaf1d229716cfafefaa Mon Sep 17 00:00:00 2001 From: Pavel Kirilin <win10@list.ru> Date: Mon, 21 Jun 2021 01:40:37 +0400 Subject: [PATCH] Fixed file sending. Signed-off-by: Pavel Kirilin <win10@list.ru> --- bot_s3rius/actions/video_converter.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bot_s3rius/actions/video_converter.py b/bot_s3rius/actions/video_converter.py index 65b7e83..028f2ad 100644 --- a/bot_s3rius/actions/video_converter.py +++ b/bot_s3rius/actions/video_converter.py @@ -35,11 +35,13 @@ async def find_py_package(event: events.NewMessage.Event): str(converted_file), {"crf": 35} ).execute() - reduced_size = (converted_file.stat().st_size / video_path.stat().st_size) * 100 - - await event.reply( - f"Reduced {reduced_size}%.", + await event.send_file( + entity=await event.get_input_chat(), file=converted_file, + caption="Рвот и Ð²Ð¸Ð´Ð¾Ñ Ñ Ð½Ð¾Ñ€Ð¼Ð°Ð»ÑŒÐ½Ñ‹Ð¼ размером.", + force_document=False, + reply_to=event.message, + supports_streaming=True, ) video_path.unlink() -- GitLab