Keyboard widget types

Each keyboard provides one or multiple inline buttons. Text on button is rendered using text widget

  • Button - single inline button. User provided on_click method is called when it is clicked.

  • Url - single inline button with url

  • LoginURLButton - a single inline button with HTTPS URL used to automatically authorize the user

  • SwitchInlineQuery - single inline button to switch inline mode

  • SwitchInlineQueryCurrentChat - a single inline button that inserts the bot’s username and specified inline query into the current chat’s input field

  • SwitchInlineQueryChosenChatButton - a single inline button that prompts the user to select one of their chats based on the specified scopes, opens the selected chat, and inserts the bot’s username and the given inline query into the input field

  • Group - any group of keyboards one above another or rearranging buttons.

  • Row - simplified version of group. All buttons placed in single row.

  • Column - another simplified version of group. All buttons placed in single column one per row.

  • ScrollingGroup - the same as the Group, but with the ability to scroll through pages with buttons.

  • ListGroup - group of widgets applied repeated multiple times for each item in list

  • Checkbox - button with two states

  • Select - dynamic group of buttons intended for selection use.

  • Radio - switch between multiple items. Like select but stores chosen item and renders it differently.

  • Multiselect - selection of multiple items. Like select/radio but stores all chosen items and renders them differently.

  • Toggle - to switch between elements of the list

  • Calendar - simulates a calendar in the form of a keyboard.

  • TimeSelect - time selection form.

  • Counter - couple of buttons +/- to input a number

  • SwitchTo - switches window within a dialog using provided state

  • Next and Back - switches state forward or backward

  • Start - starts a new dialog with no params

  • Cancel - closes the current dialog with no result. An underlying dialog is shown

  • RequestPoll - a single reply keyboard button that asks the user to create a poll and send it to the bot