Add Buttons for User Input
Last updated
Last updated
While a text interface is great for allowing people to engage with natural language, there are times when a simple button has advantages allowing you to interact with specificity and save time for the user.
Below is an example of how you could insert buttons in the chatbot's response. It uses a standard HTML button element with an onclick
attribute to run the `getReply() function of the chatbot library. Notice how each argument in the getReply
functions ('hello', 'bye', or 'youre awesome') is a string that will match a trigger in your Rivescript file.
That's it. Modify as needed.