Button usage - Rasa Open Source - Rasa Community Forum

👋 Introducing the Rasa Playground

Button usage

You have selected 0 posts.

824 views

post by Zeusturbo on Jun 16, 2021

Is there any other way that I can use “only buttons” without “text” in custom action?

I need to use a button functionality. while I try to use “utter_message” i should add the “text” attribute also. but I don’t want to display text above my button.

Thanks

post by nik202 on Jun 16, 2021

@Zeusturbo Then what the significance of the button without text? I think you can exclude the text and pass button only or you can use template i.e template=“utter_message”

button2=[\
                  {\
                      "title": "great",\
                      "payload": "great"\
                  },\
                  {\
                      "title": "super sad",\
                      "payload": "super sad"\
                  }\
              ]

dispatcher.utter_message(text="Hey! How you doing?", buttons=button2)

Or

dispatcher.utter_message(template="utter_message")

post by Zeusturbo on Jun 16, 2021

@nik202 hi thanks for the response. i did the same way as you mentioned. see the image below.
but I need the second button has to display below. not aside. please check the image below.

post by nik202 on Jun 16, 2021

@Zeusturbo Can you mention which front end you are using for the deployment purpose? Well, this issue is related to the front end not with Rasa. If you can share which then I can help. Try different colors for the button to differentiate.

post by Zeusturbo on Jun 17, 2021

@nik202 Hi, Currently im using Telegram to test my stuff. i tried with RasaX already but it was not worked as per my expectations. so i stick with Telegram in the meanwhile.

post by nik202 on Jun 17, 2021

@Zeusturbo Honestly saying these issue is related to Front End only, I mean Telegram ( thou I never used Telegram, is you can customize the code?) If not I will encourage to use Rasa Webchat for deployment purpose.

For Integration please follow this link Rasa Webchat Integration - #119 by Horizon733

I hope it will help you

post by Horizon733 on Jun 17, 2021

Oh you want it to be vertical instead of horizontal right?
Add this into your buttons json

json = {
"text": "your text",
    "button_type": "vertical",
    "buttons":[\
{\
     "title": "yes",\
      "payload": "/affirm"},\
{"title": "No",\
      "payload": "/deny"\
}\
]
}

post by Zeusturbo on Jun 17, 2021

@Horizon733 Yep, I need to display the button in a vertical way.