Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook messenger:使用node.js在bot框架上启动bot与用户之间的对话_Node.js_Facebook_Azure_Botframework - Fatal编程技术网

Facebook messenger:使用node.js在bot框架上启动bot与用户之间的对话

Facebook messenger:使用node.js在bot框架上启动bot与用户之间的对话,node.js,facebook,azure,botframework,Node.js,Facebook,Azure,Botframework,我正在尝试创建一个聊天机器人,当用户重新访问facebook messenger上的聊天时,它将检测并启动对话 有人能告诉我吗 我的当前代码: bot.on('conversationUpdate', function (message) { if (message.membersAdded) { message.membersAdded.forEach(function (identity) { if (identity.id === messa

我正在尝试创建一个聊天机器人,当用户重新访问facebook messenger上的聊天时,它将检测并启动对话

有人能告诉我吗

我的当前代码

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');
            }
        });
    }
});
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?
预期结果

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');
            }
        });
    }
});
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?

不幸的是,您所寻求的功能并不存在。机器人程序可以识别用户何时不熟悉对话,然后发布欢迎消息。但是,如果没有与机器人进行某种程度的用户交互,机器人无法识别用户已离开设备并在稍后返回

史蒂夫