Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get channel name in Bot Framework

I am working on MS Bot Framework App.I want to know how many peoples are coming from specific channels like via webchat, DirectLine, etc. I want to maintain a log of this. How to can I get channel name from context?

like image 289
Amol Pawar Avatar asked Jun 12 '17 05:06

Amol Pawar


2 Answers

You can use the following code to get the channel type:

context.Activity.ChannelId

For example, if it is "telegram", you've gotten the message from the "telegram".

like image 130
OmG Avatar answered Oct 06 '22 15:10

OmG


If someone from Node.js needs this information too, channel name is stored in, as far as I know:

session.message.address.channelId

and in:

session.message.source
like image 29
Pierre Hofman Avatar answered Oct 06 '22 15:10

Pierre Hofman