From 7a0ce10c56c3d3ce766a3eca54fb15a2c670d45e Mon Sep 17 00:00:00 2001 From: er8dd Date: Sat, 2 Mar 2024 20:50:40 +0400 Subject: [PATCH] mailing size limit --- olgram/commands/menu.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/olgram/commands/menu.py b/olgram/commands/menu.py index fcd75df..3d097f0 100644 --- a/olgram/commands/menu.py +++ b/olgram/commands/menu.py @@ -358,6 +358,8 @@ async def mailing_text_received(message: types.Message, state: FSMContext): obj = message.audio elif message.content_type == types.ContentType.VIDEO: obj = message.video + if obj.file_size and obj.file_size > 4194304: + return await message.answer(_("Слишком большой файл (4 Мб максимум)")) try: await obj.download(buffer, timeout=5)