How to filter non-document-type in aiogram v.2s?

21 Views Asked by At

I need to handle "document" content types in telegram bot, but firstly i have to filter non-document messages. my code:

@dp.message_handler(lambda message: not message.document, state=BookStatesGroup.destination)
async def check_book(message: types.Message):
    await message.reply("This is not pdf file. Please, send pdf file")

check_book is working properly, but it filters only text messages not video, photo, sticker message.Thanks in advance. versions: python - 3.11.2
aiogram==2.21

0

There are 0 best solutions below