简体   繁体   English

Facebook Messenger:使用Node.js在Bot框架上启动Bot与用户之间的对话

[英]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.

相关问题 Node.js中的Facebook Messenger机器人 - Facebook Messenger bot in Node.js 使用node.js在bot框架上的Facebook Messenger的参数call_to_actions中找到无效的密钥 - Invalid key found in param call_to_actions for Facebook messenger on bot framework using node.js 如何在 Node.js 中使用 RiveScript 回复 Facebook Messenger 机器人 - How to use RiveScript in Node.js to reply with a Facebook Messenger bot 如何使用Microsoft Bot框架使Bot与Slack中的用户在群组中发起1:1对话? - How to make the bot initiate 1:1 conversation in a group with the user in Slack using Microsoft bot-framework? 等待用户输入以使用Node.js在Facebook机器人上回复 - wait for user input to reply on a facebook bot using Node.js Bot Framework如何使用发布了“ endofConversation”活动的node.js结束对话? - Bot Framework how to end a conversation using node.js with “endofConversation” activity posted? 使用Node JS将Bot Framework对话保存到Azure SQL - Saving Bot Framework conversation to Azure SQL using Node JS BotBuilder for Node.js v3和Microsoft Bot Framework:如何远程触发与用户的新对话的开始? - BotBuilder for Node.js v3 & Microsoft Bot Framework: How do I remotely trigger the start of a new conversation with a user? 如何使用 Node.js node-telegram-bot-api 从电报机器人订阅和取消订阅用户? - How to subscribe and unsubscribe a user from a telegram bot using Node.js node-telegram-bot-api? 是否可以在单一的node.js服务器中做多个facebook Messenger机器人 - is it possible to do multiple facebook messenger bot in singe node.js server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM