1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-05-24 08:43:26 +00:00

mailing size limit

This commit is contained in:
er8dd 2024-03-02 20:50:40 +04:00
parent 120fdef189
commit 7a0ce10c56

View File

@ -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)