【问题标题】:While deploy chat bot on Azure , Auto Welcome Message doesn't work?在 Azure 上部署聊天机器人时,自动欢迎消息不起作用?
【发布时间】:2019-09-19 09:02:38
【问题描述】:

在机器人模拟器中工作完美

但是在 Deployemnt 时,我们测试了这个功能,自动启动欢迎消息不起作用。 查看下面的屏幕截图了解详情。

请帮帮我!1我遇到了这个问题
个人联系:+91 9786252624 https://i.stack.imgur.com/JZWcY.png

【问题讨论】:

标签: azure deployment frameworks botframework chatbot


【解决方案1】:

我只是将 member.id 检查的条件更改为 === 而不是 !== 并为模拟器和网络聊天修复了它。除了这些渠道之外,我的一个机器人在 Teams 中运行,在这种情况下它不会给我欢迎消息,这是我想要和期望的。这是我的 bot.js 文件中的代码。

        this.onMembersAdded(async (context, next) => {
            const membersAdded = context.activity.membersAdded;

            for (let member of membersAdded) {
                if (member.id === context.activity.recipient.id) {
                    await context.sendActivity(welcomeMessage);
                }
            }

            // By calling next() you ensure that the next BotHandler is run.
            await next();
        });

【讨论】:

  • 它的作品完美。你节省了我的时间。谢谢哥们!!
猜你喜欢
  • 2021-07-30
  • 1970-01-01
  • 2021-09-28
  • 2021-04-27
  • 1970-01-01
  • 1970-01-01
  • 2018-04-21
  • 2020-05-18
  • 1970-01-01
相关资源
最近更新 更多