Answer the question
In order to leave comments, you need to log in
How to properly implement list navigation in a chatbot?
Hello. There is a product output cycle, how to make product navigation. For example, I display one product (+ inline button(s)) and attach a "Next" button, clicking this button opens the next product, while updating the message (the first product). The "Back" button is the reverse action. I roughly understand that you need to use answerCallbackQuery() (although I may not understand it), but how ... How to implement it correctly ... Please help. Maybe there are other solutions ..
Something like a multi-level menu
for i in ['Товар1', 'Товар2', 'Товар3']:
отправляю боту текст кнопок i + реплай кнопку Далее
Answer the question
In order to leave comments, you need to log in
If I understand the essence of the question correctly, then here is a solution:
When creating inline buttons "Next" and "Back" in the callback data, write down the ID of the next and previous product, respectively. When you click on the button, just take the ID that is loaded into it, use it to access the database, pull out all the information about the product and the IDs of neighboring products. Do edit_message_text by changing the data in the message and filling inline buttons with new IDs.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question