A
A
Alexander2019-01-06 11:22:44
Java
Alexander, 2019-01-06 11:22:44

How to change InlineKeyboardMarkup (Java)?

Hello. I want to change the already sent built-in keyboard (InlineKeyboardMarkup), but nothing happens.
I change it by sending EditMessageText:

new EditMessageText()
                .setChatId(update.getCallbackQuery().getMessage().getChatId())
                .setMessageId(update.getCallbackQuery().getMessage().getMessageId())
                .setReplyMarkup(getInlineKeyboardMarkupPageFirst())
                .setText("Новый текст");

In addition to EditMessageText, I also tried sending EditMessageReplyMarkup with the same parameters (except text).
As a result, the keyboard does not change, the request leaves, but nothing happens. Like wrong messageId or something.
What am I doing wrong?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-01-06
@81x08

It's decided.
The problem was that when sending a request, there was a cast to SendMessage. Replaced with BotApiMethod.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question