简体   繁体   English

Microsoft Teams 中的对话

[英]Conversation in Microsoft Teams

We need to automate few notifications from our web application.我们需要从我们的 Web 应用程序中自动化一些通知。 These get triggered at various phases, for eg.这些在各个阶段被触发,例如。 Step A, B or C would trigger emails to specific parties.步骤 A、B 或 C 会触发向特定方发送电子邮件。

AS an improvisation to this, teams integration is being looked at where a specific channel is being created and with webhook, the messages can be posted.作为对此的即兴发挥,团队集成正在查看创建特定频道的位置,并使用 webhook 发布消息。

I created a custom channel with an incoming webhook and I posted a JSON request (of type @messagecard) which was viewable in the channel.我创建了一个带有传入 webhook 的自定义频道,并发布了一个 JSON 请求(@messagecard 类型),该请求可在频道中查看。 But the need is to really establish a conversation and not separate individual messages.但需要的是真正建立对话而不是单独的消息。 By conversation, we mean a scenario or tree structure like below通过对话,我们的意思是像下面这样的场景或树结构

OverAll status 1 (Parent message) --> subsequent reply (child message) ---> subsequent reply (child message) OverAll状态1(父消息)-->后续回复(子消息)--->后续回复(子消息)

I did some R&D and found that the incoming webhook post request does not return any message id (thsi feature doesnt exist)我做了一些研发,发现传入的 webhook post 请求没有返回任何消息 ID(该功能不存在)

What I do not understand is how bots (Azure or Microsoft) can help here.我不明白机器人(Azure 或 Microsoft)如何在这里提供帮助。

Please advise请指教

Webhooks/connectors is perfectly fine for the single messages, are you're seeing, but I don't think it will give you the ability to create and then continue an existing "conversation" (ie a thread). Webhooks/connectors 非常适合单个消息,您看到了吗,但我认为它不会使您能够创建然后继续现有的“对话”(即线程)。 You certainly could achieve something like this using a "bot"-based approach.您当然可以使用基于“机器人”的方法来实现这样的目标。 In practice, it's kind of "bot+extra" because you need two things:在实践中,这是一种“机器人+额外”,因为你需要两件事:

1) A bot registered into the channel. 1) 注册到频道的机器人。 This will give you some key info you need to be able to send messages from outside Teams - something called a "proactive" message.这将为您提供一些您需要能够从外部团队发送消息的关键信息 - 称为“主动”消息。 Having the bot in the channel also means you have something with the authorization to send a message to the channel 2) Next you need to implement the Proactive message.在频道中拥有机器人也意味着您有权向频道发送消息 2) 接下来您需要实现主动消息。 Have a look at my answer here to see more: Programmatically sending a message to a bot in Microsoft Teams (the answer is in C# - not sure what language/platform you're using, but the same concepts apply in Node)在这里查看我的答案以了解更多信息:以编程方式向 Microsoft Teams 中的机器人发送消息(答案是在 C# 中 - 不确定您使用的是哪种语言/平台,但相同的概念适用于 Node)

In addition to the pro-active message, once you send that first message, you need to store the message reference that comes back from "SendToConversationAsync".除了主动消息之外,发送第一条消息后,您还需要存储从“SendToConversationAsync”返回的消息引用。 You then apply it to the subsequent messages, as I've described in the answer here: How to add a mention in Teams alongside an adaptive card using Bot Framework然后,您将其应用于后续消息,正如我在此处的回答中所述: 如何使用 Bot Framework 在自适应卡旁边添加团队中的提及

Hope that helps希望有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM