[英]Facebook messenger: initiate conversation from bot to user on bot framework using node.js
I am trying to create a chatbot whereby when user revisit the chat on facebook messenger, it will detect and initiate conversation. 我正在尝试创建一个聊天机器人,当用户在Facebook Messenger上重新访问聊天时,它将检测并启动对话。
Could someone please advise me? 有人可以告诉我吗?
My current code : 我当前的代码 :
bot.on('conversationUpdate', function (message) {
if (message.membersAdded) {
message.membersAdded.forEach(function (identity) {
if (identity.id === message.address.bot.id) {
bot.beginDialog(message.address, 'revisitDialog');
}
});
}
});
Expected result : 预期结果 :
Bot to User: Ans A
User to bot: What is b?
Bot to User: Ans B
After an hour, when the user revisit the chat....
Bot to user: hi, is there anything I can help you with?
Unfortunately, the functionality does not exist for what you are seeking. 不幸的是,您所寻找的功能不存在。 Bots can recognize when a user is new to a conversation and, subsequently, post a welcome message. 僵尸程序可以识别用户何时不熟悉会话,然后发布欢迎消息。 But, there is no way for a bot to recognize a user has left their device and returned at a later point without some level of user interaction with the bot. 但是,如果没有某种程度的用户与机器人的交互,则机器人无法识别用户已离开其设备并在以后返回。
Steve. 史蒂夫。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.