Difficulty in implementing buttons in RASA bot

Hello everyone, I am trying to implement buttons to my chatbot and this is my code in domain.yml file :

templates:
utter_greet:
  - text: "Nice to you meet you {name}. How can I help?"
  buttons:
    - title: "tell me joke"
      payload: '/joke'

while training its throwing an error saying " rasa_core.domain.InvalidDomain:Utter template ‘buttons’ needs to contain ‘-text:’ attribute to be a propertemplate. "

then i changed the “-title:” tag to “-text:” tag as below:

utter_greet:

  • text: “Nice to you meet you {name}. How can I help?” buttons:
    • text: “tell me joke” payload: ‘/joke’

this is not throwing any error while training but in command line when i am testing the chatbot , buttons are not shown . Can someone help me with this? do i have to make any changes in stories.md file also? if yes, then how?

Thank you.

It looks like your indentation is wrong, can you try

templates:
utter_greet:
  - text: "Nice to you meet you {name}. How can I help?"
    buttons:
    - title: "tell me joke"
      payload: '/joke'
1 Like