如何检查用户是否打开了网络聊天窗口? [英] How to check if the user has the webchat window open?

查看:72
本文介绍了如何检查用户是否打开了网络聊天窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用botframework v4,nodeJS和Directline API 3.0创建一个客户支持机器人.客户将与机器人对话,并根据请求将对话移交给代理.如果客户要求与机器人对话,则客户将等到代理可用为止.我想在代理向他/她发送消息之前检查客户是否仍然处于活动状态.

I am creating a customer support bot using Ms botframework v4 with nodeJS and directline API 3.0. A customer would talk to the bot and on request, the conversation would be handed over to an agent. If the customer requested to talk to a bot, the customer will wait until the agent becomes available. I want to check if the customer is still active before the agent sends a message to him/her.

机器人和网站的线框如您在图片中所见在队列中,我想找出一种方法来检查Jack是否仍在等待,还是他关闭了窗口而不再等待.

wireframe of the bot and the webiste As you can see in the image Jack is in the queue I want to find out a way to check if Jack is still waiting, or he close the window and no longer waiting.

推荐答案

查看此SO

Check out this SO solution I provided. The request is similar to yours in that the OP wants to know how the bot can be notified if a user exits.

简短的答案是使用事件侦听器.在关闭包含网络聊天实例的窗口之前,将触发一个事件.该事件由网络聊天接收,该网络聊天发送活动(消息,事件或其他)以通知该机器人.

The short answer is to use an event listener. Before the window (that houses the web chat instance) is closed, an event is fired. This event is picked up by web chat which sends an activity (message, event, or other) to notify that bot.

这时,您只需要将通知转发给座席,该通知是用户已退出对话.

From this point, you simply need to forward the notification to the agent that the user has exited the conversation.

希望有帮助!

这篇关于如何检查用户是否打开了网络聊天窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆