https://docs.aiogram.dev/en/dev-3.x/migration_2_to_3.html#filtering-events
Migration FAQ (2.x -> 3.0)
This works in 2025 aiogram with filtres. Thanks to the author for the explanation
from aiogram import Bot, Dispatcher
from aiogram.types import Message
from aiogram import F
import asyncio
from secret import TOKEN
dp = Dispatcher()
bot = Bot(token=TOKEN)
@dp.message(F.voice)
async def voice_message_handler(message: Message):
path = "/home/user/"
await bot.download(
message.voice,
destination=path + "%s.ogg" % message.voice.file_id
)
asyncio.run(dp.start_polling(bot))