0

I'm looking for a way to identify whether a user is sending a message with the Skype web control and not through the standard client. Is there any parameter attached to the session object or any other way to do so? Or maybe a ref parameter like Facebook messenger has?

I would like to know also if the user is authenticated or not - I could see that the name is always Guest but it doesn't seem to be a very robust way to check it.

Amit be
  • 469
  • 3
  • 13

1 Answers1

2

You can detect it via bot receive middleware event, e.g.

bot.use({
  receive: function (event, next) {
    // handle `event.entities` for your needs
    console.log(event.entities)
    next();
  },
}); 

the event.entities shoule be like:

 [ { locale: 'en-US',
       country: 'US',
       platform: 'Web',
       type: 'clientInfo' } ],

and for skype for web, the platform property is Web, for windows client, the platform property is Windows.

Gary Liu
  • 13,758
  • 1
  • 17
  • 32
  • hey, I tested this solution but it seems like I'm not getting the `platform`. the output looks like this: `0:Object {locale: "en-US", type: "clientInfo"} locale:"en-US" type:"clientInfo"` – Amit be Jul 15 '18 at 12:03
  • @Amitbe, where and how you get these info? – Gary Liu Jul 16 '18 at 02:32
  • I used the method you've provided `bot.use...` – Amit be Jul 16 '18 at 14:36
  • @gary-liu-msft did you have a chance to check it? – Amit be Jul 19 '18 at 09:43
  • @Amitbe, actually, I tested directly on Azure Bot Service, and leverage the online code Editor to check the outputs. Unfortunately, I cannot reproduce your issue. Could you tell me how to reproduce your issue, maybe? – Gary Liu Jul 20 '18 at 00:36
  • @gary-liu-msft well I just pasted the code to my bot, it uses libraries. does it have anything to with being authenticated or not? – Amit be Jul 22 '18 at 18:19