diff --git a/games/uwu.py b/games/uwu.py index 0ad5108..634e4f1 100644 --- a/games/uwu.py +++ b/games/uwu.py @@ -68,15 +68,18 @@ async def handle_uwu_cmd(message: types.Message): await message.reply("У найденного поста нет прямого URL изображения :(") return - input_file = types.URLInputFile(file_url) caption = random.choice(CAPTIONS) - if ext in ("png", "jpg", "jpeg", "webp"): + if ext in ("gif", "webm", "mp4"): + # Для анимаций: отправляем caption отдельным сообщением, + # а саму гифку/видео через URL напрямую — так Telegram + # корректно показывает её как анимацию, а не как файл + await message.answer(caption) + await message.answer_animation(animation=file_url) + elif ext in ("png", "jpg", "jpeg", "webp"): + input_file = types.URLInputFile(file_url) await message.answer_photo(photo=input_file, caption=caption) - elif ext == "gif": - await message.answer_animation(animation=input_file, caption=caption) - elif ext in ("webm", "mp4"): - await message.answer_video(video=input_file, caption=caption) else: + input_file = types.URLInputFile(file_url) await message.answer_document(document=input_file, caption=caption) except Exception as e: