【问题标题】:Facebook messenger: initiate conversation from bot to user on bot framework using node.jsFacebook messenger:使用 node.js 在 bot 框架上发起从 bot 到用户的对话
【发布时间】:2018-04-25 06:04:16
【问题描述】:

我正在尝试创建一个聊天机器人,当用户重新访问 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?

【问题讨论】:

    标签: node.js facebook azure botframework


    【解决方案1】:

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

    史蒂夫。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多