Ask the bot to stop

Hello guys,

So I have developed custom actions to answer a few intents with multiple messages (i. e. a sequence of messages that I send back to back).

I wanted to add a way for the user to ask the bot to stop answering. Let’s say the bot is sending 10 messages to answer a request and the user decides to ask the bot to stop by the 3rd message, do any of you know how to do this?

Thank you.

@b.emna Heya! You means your questions have 10 answers and they are coming one by one in sequence and you (user) want to pause the questions after seen 2 response or 5 response and so on. What is the significance of this approach, at the end you need to see all the answers for your question. Please clear!

Hey @nik202,

As you know the user’s behaviour is not linear, they can ask something and then decide not to hear the rest of the answer and move on to another request (e. g. with Alexa you can say “Alexa stop” while it’s supplying the response and it will stop).

I want to add a feature to my bot where an intent ‘stop’ could be detected and (maybe) a custom action could get the message queue of the bot, clear it and send a message like “can I help you with something else ?”.

@b.emna can you share how you displaying the messages(response) of the question? are you using domain.yml with YAML syntax or have you developed your own custom action for the response? need to see the file.

Unfortunately, I can’t share the file but I can tell you that it’s a custom action that displays multiple utterances in a row

@b.emna Its ok means you mention the utter_response with the answer in domain.yml file and using dispatcher.utter_message(template=“utter_response”, tracker) in file right? Check this Events