3
votes

Consider the following sequence:

  1. A Telegram bot sends a Message with an inline keyboard with InlineKeyboardMarkup to a specific User
  2. When the user hits one of the buttons of an InlineKeyboardMarkup, bot receives a response with a CallbackQuery
  3. CallbackQuery contains a message object, which represents the original message, which was sent in step 1, but as far as I can see in API docs, Message does not contain any information about InlineKeyboardMarkup or reply_markup.

So is it possible to get InlineKeyboardMarkup of the originally sent Message?
If there is no way of getting it, are there any workarounds in this case?

1
What are you trying to achieve? - Maak
There have no way to do this - Sean
@Maak I want to modify buttons of the originally sent keyboard, and these changes are based on the original keyboard. To be precise — I need the order of buttons in the original keyboard. - Ivan Vinogradov

1 Answers

0
votes

Update 1 June 2019

Recently Telegram Bot API developers added a new field reply_markup of type InlineKeyboardMarkup to a Message object.

So now you can get previously sent keyboard like that: Update.CallbackQuery.Message.ReplyMarkup