RichMessageButton

class pyrogram.types.RichMessageButton[source]

A button in a rich formatted message.

Exactly one of the optional fields other than style must be used to specify the type of the button.

Parameters:
  • text (str | RichText | RichText) – Text of the button. May contain only plain text, RichTextCustomEmoji and RichTextDateTime entities.

  • style (RichButtonStyle, optional) – Style of the button. Defaults to DEFAULT, an app-specific style.

  • url (str, optional) – HTTP or tg:// URL to be opened when the button is pressed.

  • callback_data (str | bytes, optional) – Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes.

  • web_app (WebAppInfo, optional) – Description of the Web App that will be launched when the user presses the button.

  • login_url (LoginUrl, optional) – An HTTPS URL used to automatically authorize the user. Not supported for ephemeral messages.

  • switch_inline_query (str, optional) – If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot’s username and the specified inline query in the input field.

  • switch_inline_query_current_chat (str, optional) – If set, pressing the button will insert the bot’s username and the specified inline query in the current chat’s input field.

  • switch_inline_query_chosen_chat (SwitchInlineQueryChosenChat, optional) – If set, pressing the button prompts the user to select one of their chats of the specified type, opens that chat and inserts the bot username and an optional inline query in the input field.

  • copy_text (CopyTextButton, optional) – A button that copies the specified text to the clipboard.

  • disabled (DisabledButton, optional) – If set, then the button is disabled and does nothing.