Create different answers based on channel that is used

I’m wondering how one could create different responses based on the channel that is used in a multi-channel bot. Is there a way, e.g. o find out what channel has been used for this conversation from within a custom action?

The reason is that due to UX reasons, some of my buttons need to be customized for every channel. But how can rasa_core or the action server know what channel the message was sent through?

1 Like

We started implementing it, but the template mechanism in the domain doesn’t distinguish between the different channels yet.

But we attach the input channel to every message, so during NLG generation we can actually use different templates for the different channels. If you take a look at https://github.com/RasaHQ/rasa_core/blob/master/rasa_core/nlg/template.py#L23 you can see that the output channel is known, but that the selection of the response template does not yet depend on it. I think this would make for a great contribution :wink:

Created a PR for this here