Menu with numbers

How to make a menu based on numbers

Example:

  1. Option one
  2. Option two
  3. Option three

@NikoAP77 Hi, you want that user type 1 or 2 or 3 and your message will come? right?

@NikoAP77 I hope this will solve your issue?

In domain.yml

 intents:
  - one
  - two
  - three

utter_menu:
- text: Select the topic or write your question below.
  buttons:
      - title: 1
        payload: /one
      - title: 2
        payload: /two
      - title: 3
        payload: /three        
              
          
    utter_ask_one:
       - text: you selected one
    utter_ask_two:
       - text: you selected two
    utter_ask_three:
       - text: you selected three

In nlu.yml

version: "2.0"
nlu:
  - intent: one
    examples: |
      - 1
      - one
      - one please
      - 1 please

 - intent: two
    examples: |
      - 2
      - two
      - two please
      - 2 please

 - intent: three
    examples: |
      - 3
      - three
      - three please
      - 3 please

In stories.yml

version: '2.0'
stories:
  - story: one menu
    steps:
      - intent: one
      - action: utter_ask_one

   - story: two menu
     steps:
      - intent: two
      - action: utter_ask_two

   - story: three menu
     steps:
      - intent: three
      - action: utter_ask_three

Please mention other important code in domain, it will run based on selection and whilst user input. If code not run, may be I made some stupid error.Good Luck!

@NikoAP77 If you able to solve this error with the suggestion/solution please I request to close this thread with the solution for others, who are seeking the solutions. Thanks

1 Like