Send message to a particular sender id

Is it possible to send a message (bot response) to a particular sender id in custom action?

I’m curious, what’s the use case for this?

Usually, the messages are sent back to the sender_id of the current conversation (i.e. the sender who sent the message that triggered the action). But it is also possible to send messages to someone else.

You need to import the OutputChannel class for the channel you are using, e.g. if you are talking to your bot via Facebook that would be rasa.core.channels.facebook.MessengerBot. Every output channel has a function send_response(self, recipient_id: Text, message: Dict[Text, Any]). That can be used to send a message to any id.

Let me know if that works for you!

Thanks @chkoss for your kind answer. Is it possible to setup rasa with socket events, i mean if rasa will connect with it’s customer throw socket events then rasa will able to send a message to any customer at any time.

Sorry, I don’t quite get your question. Can you rephrase or explain a bit more?

issue has been fixed by calling an system API