User ask for something, the bot emits a list of buttons, user click one, the bot acts on it…and bob is your uncle.
However, the problem starts when each button item has very long texts. Rasa crunches these texts and shove all the buttons horizontally.
Is there a way to display buttons vertically?
Like one by one, per line?
I came across this github issue where @erohmensing suggested the use of button_type: vertical.
Maybe that can work if my resonses are already known and hardocoded in domains.yml
But my response is a result of a network call.
And I cant find where or how to implement it using either utter_button_message or utter_message
I am not particularly hung on buttons though.
If an unordered list will work, fine.
So if buttons cant be implemented vertically for my use-case, can you please show me how to display a list of items and make each clickable like a button to specific payloads?
@amn41 suggested here that you can utter these items one by one…and that might work, but what if the List span many items? Wont that be too cringe-worthy?
Hey @wale, I believe you should be able to pass any keyword args through utter_message. For example:
buttons = [{},{}] # some list of button dicts, doesn't matter
dispatcher.utter_message(text="Some message", buttons=buttons, button_type=vertical)
However, this will only work on the telegram frontend because that is the channel that defines that keyword argument.
Otherwise, you would have to check with whichever connector you are using to see if there is an easy way to output the buttons – this logic is handled in the connector, which you can customize.
Seems like the best shortterm solution. Unfortunately each platform has different formats for outputs and what it can accomplish, so we can only do so much