mirror of
https://github.com/civsocit/olgram.git
synced 2025-12-15 20:56:18 +00:00
mailing size limit
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user