I
I
i_ikigai2020-07-23 21:22:32
Python
i_ikigai, 2020-07-23 21:22:32

How to add an inline button in aiogram which will display different text depending on the pressed button?

There is a code for outputting a random movie by clicking on the inline button, but it displays this movie as a message. How to make the movie appear in the inline button?
5f19d515018cd871847412.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-07-24
@morz45

The question is not clear, if you need a separate button, then just send a new keyboard with one button (or replace the old one with a new one). Here is a detailed lesson in Russian.
If you need to replace one button in an existing keyboard (for example, like the bottom empty button in the picture), then this is not possible, you can also only replace the keyboard with a new one, like the old one, but with a different button. (pull out the message_id from the callback and replace the keyboard of this message with edit_reply_markup ).
In the documentation, you can see how InlineKeyboardMarkup works and make your own factory (constructor)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question