How to ignore messages sent before an action was run but that were received after it?

Hi there!

Quite frequently, users send a second message before the bot had time to answer the first message. From the bot perspective, this second message is received and processed after it has answered. A simple workaround would be to ignore these messages altogether. Is there a way or a hack to have Rasa Core ignore user messages received before the last bot utterance/action was sent? If not, any pointers on where to look into hacking Rasa Core for that?

In a similar thread, someone suggested blocking messages on the front-end side. Unfortunately, this is not possible because we use Facebook Messenger and SMS.

A simple example:

User: Hello

User: How are you

Bot: Hey there!

Bot: What do you want to do?

From the bot perspective, the story actually looks like:

* greet
- utter_greet
- utter_what_want_to_do
* how_are_you

In this simple case, it’s not a problem as the resulting story is ok. However, it can make things very strange in other parts of the conversation.

Thanks for your help! Cheers, Nicolas

2 Likes

You can do this by modifying the connector, but it is not very simple. There is an example in this repository of how to achieve this. Take a look at the Message Collector, which does almost everything you want.

1 Like