How to use a bot in several channels
If one bot is published in several channels, it processes the data it gets in different ways. Depending on a particular channel, the bot uses different variables to process data, for example, information sent by the client.
In this case, you have to determine the channel type by placing a $channelType
system variable into the Conditions block:
- Add the Conditions block when getting client data with the help of the
$rawRequest
system variable. - Add a condition for each channel you have connected to your bot. For example, if you connect chat widget and Facebook, add the following conditions:
$channelType === "chatwidget"
$channelType === "facebook"
- For each channel, configure script branches.
Channel types
Possible values of the $channelType
system variable:
Channel | $channelType |
---|---|
Chat API | chatapi |
Chat widget | chatwidget |
facebook | |
instagram | |
JivoChat | incoming_jivosite |
Microsoft Teams | azure |
Telegram | telegram |
Telephony | resterisk |
Viber | viber |
Vonage | nexmo |
wechat | |
whatsapp |