The docs say ChosenInlineResult.inline_message_id is "available only if there is an inline keyboard attached to the message". Since Bot API 10.3 buttons can also live inside rich message content (<tg-button-row>/<tg-button> in InputRichMessage.html), and messages sent this way behave inconsistently between the two update types:
callback_query updates from taps on the in-content buttons carry inline_message_id, so the message clearly has one allocated.
- The
chosen_inline_result update for the same message does not carry it.
I guess the original reasoning was that a message without a keyboard is one the bot can never interact with again, so there was no point in handing out an id for it. With rich buttons that assumption no longer holds: the message is just as interactive, its taps produce normal callback queries, and it can be edited through the id those carry. But the condition still only checks for a classic keyboard, so this looks like an oversight from the rich messages update rather than intended behavior.
Steps to reproduce
- Answer an inline query with an
InlineQueryResultArticle whose input_message_content is an InputRichMessageContent with a rich_message whose html includes a <tg-button-row> with a callback_data button. Do not set reply_markup.
- Have a user pick the result (inline feedback enabled).
- The
chosen_inline_result update arrives without inline_message_id.
- Tap the in-content button on the sent message: the resulting
callback_query does carry inline_message_id.
Why it matters
chosen_inline_result is the only moment a bot can bind an inline message to its own state before users interact with it. With rich content buttons there is no way to learn the inline_message_id until someone presses a button, so bots that track or authorize their inline messages cannot move their inline results to rich buttons. The workaround for now is to keep a classic reply_markup on inline results, which defeats the point of rich buttons there.
Expected behavior
chosen_inline_result.inline_message_id is present whenever the sent message carries tappable rich buttons, same as callback_query already does.
The docs say
ChosenInlineResult.inline_message_idis "available only if there is an inline keyboard attached to the message". Since Bot API 10.3 buttons can also live inside rich message content (<tg-button-row>/<tg-button>inInputRichMessage.html), and messages sent this way behave inconsistently between the two update types:callback_queryupdates from taps on the in-content buttons carryinline_message_id, so the message clearly has one allocated.chosen_inline_resultupdate for the same message does not carry it.I guess the original reasoning was that a message without a keyboard is one the bot can never interact with again, so there was no point in handing out an id for it. With rich buttons that assumption no longer holds: the message is just as interactive, its taps produce normal callback queries, and it can be edited through the id those carry. But the condition still only checks for a classic keyboard, so this looks like an oversight from the rich messages update rather than intended behavior.
Steps to reproduce
InlineQueryResultArticlewhoseinput_message_contentis anInputRichMessageContentwith arich_messagewhosehtmlincludes a<tg-button-row>with acallback_databutton. Do not setreply_markup.chosen_inline_resultupdate arrives withoutinline_message_id.callback_querydoes carryinline_message_id.Why it matters
chosen_inline_resultis the only moment a bot can bind an inline message to its own state before users interact with it. With rich content buttons there is no way to learn theinline_message_iduntil someone presses a button, so bots that track or authorize their inline messages cannot move their inline results to rich buttons. The workaround for now is to keep a classicreply_markupon inline results, which defeats the point of rich buttons there.Expected behavior
chosen_inline_result.inline_message_idis present whenever the sent message carries tappable rich buttons, same ascallback_queryalready does.