使用 Bot Framework 4 的一对一主动消息传递 [英] 1-to-1 Proactive messaging using Bot Framework 4

查看:28
本文介绍了使用 Bot Framework 4 的一对一主动消息传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 C# (.NET Core) 和 Bot Framework v4 来开发机器人服务.我是 Bot Framework 的初学者.

I am using C# (.NET Core) with Bot Framework v4 to develop a bot service. I am a beginner to Bot Framework.

问题陈述如下:

  • 我希望能够在 o365 SharePoint 上存储一些问题在列表中订阅.列表的数据结构将有一个包含作为目标受众的用户的列问题.
  • 当一个问题被添加到列表中时,我希望我的机器人发送向 Microsoft Teams 的目标用户提问.
  • 即使用户不在线加入团队,我也想发送一个在 Teams 聊天中向用户发出通知,例如错过了对话".

现在,我从初学者的角度理解,这里的关键是使用 Bot 进行主动消息传递.我在任何论坛文章中无法弄清楚或找到的是,我如何编写我的机器人以转到 SharePoint(可能使用轮询或事件驱动)并获取信息,然后将获取的数据发送给个人用户 1-一对一团队聊天?

Now, I understand, on a very beginner level, that the key here is Proactive messaging using the Bot. What I can't figure out or find on any forum articles is that how do I write my bot to go to SharePoint (could be using polling or event driven) and fetch information and then send out the fetched data to Users on personal 1-to-1 team chat?

到目前为止我所做的是:

What I have done so far is :

  • 我已经编写了我的 SharePoint 业务逻辑来获取信息.
  • 当机器人收到来自用户.即,说,用户说嗨",机器人去取来自 SharePoint 的信息并将其返回给聊天中的用户窗口.

任何帮助将不胜感激.

干杯,

约格什

推荐答案

我的猜测是您应该能够实现目标,但在寻求帮助时确保将其分解为较小的问题.您可能还需要介于两者之间的一些其他层来完成.

My guess is that you should be able to accomplish the goals, but make sure to break this up into smaller problems when looking for assistance. You might need some other layers between the two to accomplish as well.

如您所见,主动消息将是您希望从机器人端向用户发送消息而无需他们先与机器人互动的内容.如果用户之前从未与机器人进行过交互,您将不会获得任何成功(尤其是在 Teams 中),因为机器人需要某种方式才能知道如何联系他们(之前的对话等).请查找更多信息 此处此处.

As you have found, proactive messages will be what you want to use from the bot side to message users without them engaging the bot first. You won't find any success (especially in Teams) if the users have never interacted with the bot before as there will need to be some sort of way for the bot to be able to know how to contact them (former conversation, etc). Please find more information here and here.

我在任何论坛文章中都无法弄清楚或找到的是我该怎么做编写我的机器人以转到 SharePoint(可能正在使用轮询或事件驱动)并获取信息,然后将获取的数据发送到个人一对一团队聊天的用户?

What I can't figure out or find on any forum articles is that how do I write my bot to go to SharePoint (could be using polling or event driven) and fetch information and then send out the fetched data to Users on personal 1-to-1 team chat?

我已经编写了我的 SharePoint 业务逻辑来获取信息.这bot 在收到来自用户的活动时调用此业务逻辑.即说,用户说嗨";然后机器人去获取信息来自 SharePoint 并将其返回给聊天窗口中的用户.

I have written my SharePoint business logic to fetch information. The bot calls this business logic when it receives an activity from User. i.e. say, a user says "Hi" and the bot goes and fetches information from SharePoint and returns it to the user in the chat window.

所以;似乎您缺少的部分是进行轮询等的中间层.主动示例,只是使用转向事件然后主动"向用户发送消息.您可能需要发挥创意.有某种其他服务/计时器作业/无服务器功能可以提供帮助.

So; it seems like the part you are missing is an intermediate layer that does polling or such. The proactive sample, is just using turn events to then 'proactively' message the user back. You might have to get creative. Have some sort of other service/timerjob/serverless function that might be able to assist.

这是一篇针对 v3 的文章,但关于主动消息的总体思路很好,有助于理解如何最好地处理主动消息范式并确保良好的用户体验:https://docs.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-proactive-messages?view=azure-bot-service-3.0#send-a-dialog-based-proactive-message

This is an article for v3, but the general idea about proactive messages is good and helps understand how to best approach proactive message paradigm and ensure a good user experience: https://docs.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-proactive-messages?view=azure-bot-service-3.0#send-a-dialog-based-proactive-message

这篇关于使用 Bot Framework 4 的一对一主动消息传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆