A
A
Alikhan2021-12-02 17:17:39
Python
Alikhan, 2021-12-02 17:17:39

How to change inline button text when aiogram is clicked?

how to change inline button text on aiogram click?
That is, the text of the inline button itself and not the message to which it belongs.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
inworkl, 2021-12-02
@inworkl

You just write a function so that when you click on the inline button, a new keyboard is generated.
Roughly speaking, when you click the <1 button, new_keyboard will drop out in the body of which <1 is already specified as 0

@dp.callback_query_handler(text='<1')
async def get_menu0(call: CallbackQuery):
    await call.answer(cache_time=2)
    await call.message.edit_text(text='Меню: ', reply_markup=new_keyboard)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question