N
N
NQUAREx2022-04-17 21:11:06
Bots
NQUAREx, 2022-04-17 21:11:06

How to handle all message types in aiogram?

How to make such a handler for all message types?

@dp.message_handler(state=Mail.message)
async def process_send_image(message: types.Message, state: FSMContext):

So that no matter what you send him, he will duplicate it. Well, + this is all with the Senks
state machine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NQUAREx, 2022-04-17
@NQUAREx

aiogram has a special key for this content_types=['any']
https://docs.aiogram.dev/en/latest/telegram/types/...

@dp.message_handler(state=Mail.message, content_types=['any'])
async def process_send_image(message: types, state: FSMContext):

Well, I figured it out, okay?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question