Responses

An object that represents a message.

Parameters
  • text (Optional[str]) – The message text.

  • keyboard (Optional[Keyboard]) – The message keyboard.

  • payload (Optional[dict]) – The message payload.

Format and return message text.

Return type

Optional[str]

Returns

Formatted message text.

Serialize the class instance to a dictionary.

Return type

dict

Returns

A serialized class instance.

Update the message payload.

Parameters

payload (dict) – New message payload.

Return type

None

Bases: object

An object that represents a message and can be used to change the current menu.

Parameters
  • message (Optional[Message]) – The message.

  • menu (Optional[str]) – The name of the menu to go to.

  • go_back_count (Optional[int]) – How many steps to go back.

Serialize the class instance to a dictionary.

Return type

dict

Returns

A serialized class instance.

Update the message payload.

Parameters

payload (dict) – New message payload.

Return type

None