Multiple texts

Hi everyone,

I wanted to answer with multiple “text” commands, in a way that the user can see separated messages, more dinamically.

Example of the ‘domain.yml’ archive (that didn’t work):

templates:
 utter_greet:
   -text: hey
   -text: how are you?

Is that possible?

Hey @miohana – indeed this won’t work, as this is the domain syntax for offering multiple options for the same utterances (i.e. the bot will choose randomly from them).

Depending on your output channel and how it renders newlines, doing

templates:
utter_greet:
  - text: "hey \n how are you?"

may work. However, if you want to make sure that it works everywhere, the recommended way is to just create two utterances:

templates:
 utter_greet:
   - text: "hey"
 utter_howareyou:
   - text: "how are you?"

Which you can just put into your stories like

* greet
  - utter_greet
  - utter_howareyou

or if you really wanted to only have one action in the stories, you could create a custom action action_greet that dispatches both of the utterance templates.

Hope that helps! :slight_smile:

3 Likes

Huge thanks Ella! It worked!!!

2 Likes