user2968505 user2968505 - 11 months ago 73
Node.js Question

Can a Microsoft Bot Framework based bot be connected to multiple channels?

So i have inspected multiple examples now, but i have yet to see a chat bot that is connected to say facebook and skype, not just one of them, if it is the case that your bot can be connected to multiple channels, is there a way in the code to distinguish from which channel the message is coming from ?

Answer Source

Yes, there is. The way to do it is by checking the ChannelId of the incoming message in C# or the source in the case of Node.

Here is a C# example.

if (message.ChannelId.Equals("skype", StringComparison.InvariantCultureIgnoreCase) 

Here is a Node.js example.

var isSkypeMessage = function (message) {
    return message.source === 'skype';