InlineKeyboardButton

class pyrogram.types.InlineKeyboardButton

One button of an inline keyboard.

You must use exactly one of the optional action fields.

Parameters:
  • text (str) – Label text on the button.

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

  • url (str, optional) – HTTP url opened when the button is pressed.

  • web_app (WebAppInfo, optional) – Web App launched when the button is pressed.

  • login_url (LoginUrl, optional) – HTTP URL used to automatically authorize the user.

  • user_id (int, optional) – User id – opens the user’s profile.

  • switch_inline_query (str, optional) – Prompts the user to select a chat and inserts the bot’s username and the specified inline query.

  • switch_inline_query_current_chat (str, optional) – Inserts the bot’s username and the specified inline query in the current chat’s input field.

  • switch_inline_query_chosen_chat (SwitchInlineQueryChosenChat, optional) – Prompts the user to select a chat of the specified type.

  • callback_game (CallbackGame, optional) – Description of the game that will be launched. Must always be the first button in the first row.

  • requires_password (bool, optional) – Ask for 2-step verification password before sending the callback.

  • copy_text (str, optional) – Copies the specified text to the clipboard.

  • pay (bool, optional) – True to send a Pay button.

  • style (ButtonStyle, optional) – Visual colour of the button: DEFAULT, PRIMARY (blue), DANGER (red), SUCCESS (green).

  • icon_custom_emoji_id (int, optional) – Custom emoji document ID shown on the button (stored in KeyboardButtonStyle.icon). 0 or None means no icon.