send link for videos that are too large
This commit is contained in:
parent
c7c469c8a3
commit
0f4d779e0c
4
main.py
4
main.py
@ -63,6 +63,7 @@ async def check_updates():
|
||||
file.name = f'file.{post.file.ext}'
|
||||
file.seek(0)
|
||||
if post.file.ext == 'webm':
|
||||
if post.file.size < 50_000_000:
|
||||
await bot.send_video(int(os.environ['SEND_CHAT']),
|
||||
file,
|
||||
width=post.file.width,
|
||||
@ -70,6 +71,9 @@ async def check_updates():
|
||||
thumb=post.preview.url,
|
||||
caption=caption,
|
||||
parse_mode=ParseMode.HTML)
|
||||
else:
|
||||
await bot.send_message(int(os.environ['SEND_CHAT']),
|
||||
f'File is too large: {post.file.url}\n\n' + caption)
|
||||
elif post.file.ext == 'gif':
|
||||
await bot.send_animation(int(os.environ['SEND_CHAT']),
|
||||
file,
|
||||
|
Loading…
Reference in New Issue
Block a user