Change button type in Telegram channel (with custom actions)

Hi everyone! I don’t really like the layout of the inline buttons on Telegram, as there is little space for text. In the Rasa documentation it is not clear to me. So I’m creating this topic to facilitate the community.

To change the type of buttons, just pass the button_type parameter in the utter_message method.


The result is this:


In the button_type parameter, it is possible to pass the following values: inline (default), vertical and reply.

Hope this helps.

1 Like

Here’s an example. The button type value can be inline, vertical or reply.

  - buttons:
    - payload: /affirm
      title: Yes
    - payload: /deny
      title: No
    text: These are inline buttons
    button_type: inline
1 Like

How does it work? I get yml parsing error while trying to add this param to domain.yml

 Key 'button_type' was not defined.

@alloky Make sure the spaces are present.

There’s a known issue with button_type introduced with 2.0. Should have a fix for this soon.

1 Like