A
A
AlexaAioGram2021-07-11 14:31:56
Python
AlexaAioGram, 2021-07-11 14:31:56

Why when I click on inline which in if nothing happens?

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


When I click on an inline button with a callbackdata('abc') nothing happens, although it is specified in if
Why is this and how to fix 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