Skip to content

[Bug] ChosenInlineResult omits inline_message_id when the inline result uses InputRichMessageContent with rich buttons #895

Description

@AAraKKe

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

  1. 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.
  2. Have a user pick the result (inline feedback enabled).
  3. The chosen_inline_result update arrives without inline_message_id.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions