callbackQuery's message() is deprecated
Donaboyev opened this issue · 1 comments
Donaboyev commented
I want to get Update -> callbackQuery -> message -> replyMarkup
But message() function is deprecated that says use maybeInaccessibleMessage instead.
Unfortunately, maybeInaccessibleMessage has not replyMarkup.
The goal is updating message's InlineKeyboardButtons. Or how can I achieve this in another way?
mircoianese commented
MaybeInaccessibleMessage
is a new class added by telegram because sometimes BOTs may receive callbacks from messages that they can't read.
You can check if the maybeInaccessibleMessage
is of type Message
, and then cast it. Something like this:
if (update.callbackQuery().maybeInaccessibleMessage() instanceof Message) {
Message message = (Message)update.callbackQuery().maybeInaccessibleMessage();
}