Search code examples
facebook-messenger-botrasa

I want to call new action after completing the conversation with user on secondary receiver protocol


I want to call new actions as I complete the conversation with the user on the secondary receiver protocol and I also want to pass the thread again to the primary receiver.

image

After the conversation ended, I want my chatbot to be started again.


Solution

  • To restart the conversation, include Restarted() in the events returned from your last custom action:

    class ActionName(Action):
        def name(self):
    ...
            return "action_name"
    
        def run(self, dispatcher, tracker, domain):
    ...
            return [Restarted()]
    

    You can customise action_session_start to check some condition and pass it to the appropriate receiver as well