In some cases, Teneo Developers may need to know from which Channel comes the request. For example, you have the same solution for both website and Facebook Messenger, while some of your flows are designed to be only available in website; or you have output parameters which only work with Teneo Web Chat.
The following code will return the current channel of the chatbot when available and store the value in variable sChannel which need to be defined as a Global variable. This code should be placed in Globals > Scripts > Begin Dialog .
sChannel = engineEnvironment.getParameter("channel")?:""
If the request doesn’t come from any of the channels where you deployed your chatbot, for example it is a request from the Try out panel, the value of the variable sChannel will be an empty string.
The code in this post is an example on how you can get the Channel in your Teneo solution. I hope this code example comes in handy for your project!