If I type 1 the bot falls into default fallback I add and says “Sorry, I can´t help you”.
Is there any option I can use to allow user inputs which only affects the message which is generated in the custom action script?
Hi @Gehova thank you for your suggestion. Unfortunately my messenger does not support buttons, so I think your solution won´t work. Do you have another idea?
Hi Max, i want user can choose a option by number like you but my knowledge in python is very bad
My issue is: user can chat 1 or 2 or 3 to choose the food like:
Bot: please choose you food
1: order pizza
2: order noodle
3: order pasta
User: 1
Bot: ok you choose the pizza
This is my python code. But it is not run
class chooseOption(Action):
def name(self):
return “action_choose_option”
def run(self, dispatcher, tracker, domain):
user_msg = tracker.latest_message.get('text')
print(user_msg)
if user_msg == '1':
response = "ok you choose pizza"
if user_msg == '2':
response = "ok you choose noddle"
if user_msg == '3':
response = "ok you choose pasta"
dispatcher.utter_template("response", tracker)
return []
Thank you for reply. I did it. Replace utter_template to utter_message. But i have a different issue. That’s when i want to call a formAction by an action like that ( in this case: response is a formAction). And it’s impossible. Do you have any ideas for that: choose an option by number
It´s pretty hard to help you if you provide such small information to us.
First of all, if you post your code snippets it´s much easier to follow your problem. It would also be very helpful if you describe your desired output and the actual output you get.
Error messages also helps us to understand the problem.
Did you read this article how to build a FormAction within RASA?
Since your problem is far away from mine, you can think about to post a new question in the rasa community forum because this way you can reach more developers.