代码之家  ›  专栏  ›  技术社区  ›  Amit be

确定用户何时使用Skype Web控件-僵尸框架上

  •  0
  • Amit be  · 技术社区  · 6 年前

    我正在寻找一种方法来识别用户是否通过Skype Web控件而不是通过标准客户端发送消息。 是否有任何参数附加到 session 反对还是其他方式? 或者可能是 ref 像facebook messenger的参数?

    我还想知道用户是否经过了身份验证-我可以看到名称总是 Guest 但这似乎不是一个非常有效的检查方法。

    1 回复  |  直到 6 年前
        1
  •  2
  •   Gary Liu    6 年前

    你可以通过机器人检测到它 receive 中间件事件,例如

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

    这个 event.entities 应该是这样的:

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

    对于Skype for Web, platform 属性为 Web ,对于Windows客户端, 平台 属性为 Windows .

    推荐文章