I managed using forms with FollowupAction:
rules.yml
- rule: Menu Telefonia
steps:
- intent: informa
entities:
- number: "13"
- action: telefonia_form
- active_loop: telefonia_form
- active_loop: null
form:
def submit(
self,
#value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
"""Define what the form has to do
after all required slots are filled"""
sender = tracker.sender_id
telefonia = tracker.get_slot('telefonia')
if telefonia == '1':
#dispatcher.utter_message('Opção - 1')
return [FollowupAction("")]
elif telefonia == '2':
#dispatcher.utter_message('Opção - 2')
return []
elif telefonia == '3':
#dispatcher.utter_message('Opção - 3')
return [FollowupAction("")]
elif telefonia == '4':
#dispatcher.utter_message('Opção - 4')
return [FollowupAction("")]
elif telefonia == '5':
#dispatcher.utter_message('Opção - 5')
return [FollowupAction("")]
elif telefonia == '6':
#dispatcher.utter_message('Opção - 6')
return [FollowupAction("ramal_form")]
elif telefonia == '7':
#dispatcher.utter_message('Opção - 7')
return [FollowupAction("")]
elif telefonia == '8':
#dispatcher.utter_message('Opção - 8')
return [FollowupAction("")]
else:
return[]