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

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

问题描述

我正在Bot Framework v4中使用C#(.NET Core)开发Bot服务。我是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上的目标用户发送
    问题。

  • 即使用户不在线与团队交流,我也想发送
    在团队聊天中向用户发送通知,例如缺少
    对话。

现在,我了解在初学者阶段,关键是使用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中获取
    信息,然后在聊天
    窗口中将其返回给用户。

任何帮助将不胜感激。

干杯,

Yogesh

推荐答案

我的猜测是您应该能够实现目标,但请确保在查找时将其分解为较小的问题寻求帮助。您可能还需要在这两者之间完成一些其他工作。

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.

正如您所发现的那样,从机器人端到消息用户,要使用主动消息没有他们先让机器人参与。如果用户之前从未与机器人进行过交互,您将不会获得任何成功(尤其是在团队中),因为机器人需要某种方式才能知道如何与他们联系(以前的对话等)。 。请找到更多信息此处此处

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业务逻辑来获取信息。
机器人在收到用户的活动时会调用此业务逻辑。
,例如,用户说然后机器人进入并从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/zh-cn/ 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进行1对1主动消息传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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