workaround

This commit is contained in:
bakatrouble 2023-03-22 19:25:06 +03:00
parent 85f1e3d54e
commit c548bc09e6

25
main.py
View File

@ -37,18 +37,19 @@ async def check_updates():
f'Artist: {" ".join(post.tags.artist)}\n' \ f'Artist: {" ".join(post.tags.artist)}\n' \
f'Character: {" ".join(post.tags.character)}\n\n' \ f'Character: {" ".join(post.tags.character)}\n\n' \
f'https://e621.net/posts/{post.id}' f'https://e621.net/posts/{post.id}'
if post.file.ext == 'webm': if post.file.url:
await bot.send_video(int(os.environ['SEND_CHAT']), if post.file.ext == 'webm':
post.file.url, await bot.send_video(int(os.environ['SEND_CHAT']),
width=post.file.width, post.file.url,
height=post.file.height, width=post.file.width,
thumb=post.preview.url, height=post.file.height,
caption=caption) thumb=post.preview.url,
else: caption=caption)
await bot.send_photo(int(os.environ['SEND_CHAT']), else:
post.file.url, await bot.send_photo(int(os.environ['SEND_CHAT']),
caption=caption) post.file.url,
await redis.sadd('e621:sent', post.id) caption=caption)
await redis.sadd('e621:sent', post.id)
@dp.message_handler(commands=['add']) @dp.message_handler(commands=['add'])