mirror of
https://github.com/civsocit/olgram.git
synced 2025-05-24 11:03:24 +00:00
mailing size limit
This commit is contained in:
parent
120fdef189
commit
7a0ce10c56
|
@ -358,6 +358,8 @@ async def mailing_text_received(message: types.Message, state: FSMContext):
|
||||||
obj = message.audio
|
obj = message.audio
|
||||||
elif message.content_type == types.ContentType.VIDEO:
|
elif message.content_type == types.ContentType.VIDEO:
|
||||||
obj = message.video
|
obj = message.video
|
||||||
|
if obj.file_size and obj.file_size > 4194304:
|
||||||
|
return await message.answer(_("Слишком большой файл (4 Мб максимум)"))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await obj.download(buffer, timeout=5)
|
await obj.download(buffer, timeout=5)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user