A
A
AlexaAioGram2021-07-11 13:56:24
Python
AlexaAioGram, 2021-07-11 13:56:24

How to catch if in inline constructs?

I spent 4 hours to solve this problem, and nothing happened, I decided to turn to experienced programmers, I hope for your responsiveness.

I need the Inline construct to accept if

@dp.callback_query_handler()
async def plt(call: CallbackQuery):
    if 'abc' in call.message:
        await call.message('Привет')


This code does not catch "abc" but I need to catch it, please tell me how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2021-07-11
@AlexaAioGram

Because call.message is the message (Message object) in which the user clicked the button. Call.data is needed here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question