How do I disable user input when buttons are active?

I am trying to implement a user guide thing where users can click buttons to navigate the guide. here is custom action for it:

class ActionGuideToNewUsers(Action):
def name(self) -> Text:
    return "action_guide_to_new_users"

async def run(
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]
) -> List[Dict[Text, Any]]:
    name = "Airaj"  # Fetch from DB
    buttons = [{"title": "Yes", "payload": "/guide"}, {"title": "No", "payload": "/deny_guide"}]
    message = "Hey {}! Would you like to know about our services?".format(name)
    custom = [{"input_type": "disable", "exit_button": "false"}]
    dispatcher.utter_message(text=message, buttons=buttons, elements=custom)
    return []

The issue arises when users enter text instead of clicking the button, so how can I disable text input when buttons are active? I am using Rasa 2.0.2, Rasa-SDK 2.0.0 and Rasa-x 0.33 to test things out.


Pretty sure this is something you will have to implement in your frontend application.

All you can do with Rasa is make the bot not react to any manual inputs or send a “I’m sorry, please choose one of the options above” message

1 Like

I’ll consider this as a solution, thanks! :slight_smile: