peyk.platforms.bale.types.keyboard_button

Classes

KeyboardButton(text[, request_contact, ...])

One button of the reply keyboard.

class peyk.platforms.bale.types.keyboard_button.KeyboardButton(text: str, request_contact: bool | None = None, request_location: bool | None = None, web_app: WebAppInfo | None = None, style: str | None = None)[source]

Bases: object

One button of the reply keyboard.

Variables:
  • text (str) – Text of the button.

  • request_contact (bool | None) – If True, the user’s phone number is requested.

  • request_location (bool | None) – If True, the user’s current location is requested.

  • web_app (peyk.platforms.bale.types.web_app_info.WebAppInfo | None) – Description of the Web App launched when button is pressed.

  • style (str | None) – Button color style: ‘primary’ (blue), ‘success’ (green), ‘danger’ (red).

text: str
request_contact: bool | None = None
request_location: bool | None = None
web_app: WebAppInfo | None = None
style: str | None = None
classmethod from_dict(data: dict | None) → KeyboardButton | None[source]

Parse raw Bale data into KeyboardButton.

Parameters:

data (Optional[dict]) – Raw API object or None.

Returns:

Parsed object or None.

Return type:

Optional[KeyboardButton]

Raises:

KeyError – If a required raw field is missing.