Microsoft Bot框架删除“编辑”更新机器人消息时消息的注释

发布于 2025-01-28 01:11:40 字数 300 浏览 5 评论 0原文

我已经建立了MS Teams Chatbot以及中间件,该中间件通过REST控制器成功主动更新消息(我将对话ID和活动ID传递给此REST端点)。

我测试了我的实现,除了这个烦人的

​从功能上讲,这并不重要,但是我的强迫症想摆脱它。我想知道是否可以通过修改活动的任何参数来通过UpdateActivityAsync来修改我的活动的任何参数,从而摆脱此标头。

I have built a MS Teams chatbot along with middleware that successfully proactively updates messages through a REST controller (I pass the conversation ID and activity ID to this REST endpoint).

I tested my implementation and everything works great except for this annoying

enter image description here

"Edited" header that appears. Functionally, it's not too important but the OCD in me wants to get rid of it. I'm wondering if I can get rid of this header by modifying any parameters of my Activity when passing the Activity through UpdateActivityAsync.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

硬不硬你别怂 2025-02-04 01:11:40

据我所知,更新机器人先前发送的消息的唯一方法和 是否显示编辑 flag是使用带有通用动作和的自适应卡即使这样,只有当卡在卡上的操作按钮上更新(带有action.ecute)时。

您可以将内容发送给团队作为纯文本消息或自适应卡 - 使用自适应卡,您可以使用以下记录的新的通用动作模型:

此模型的存在是为您提供机会确保卡当查看时具有最新的内容(即使在使用“刷新模型”结束并重新打开聊天之后),并且还允许您显示上下文内容对于当前用户,如果您在组或频道聊天中...这似乎具有主观的良好的副作用,当您使用InvokerSponse更新卡时,提交内容(通过实施/覆盖OnAdaptiveCardInVoke根据您选择的语言),即使您可以将全新的卡内容发送作为响应中的附件,该响应将不地位更新卡,也不会说“编辑”,甚至不会更改消息上的时间戳。

As far as I am aware, the only way to update a message previously sent by the bot and not have it display the Edited flag is to use adaptive cards with Universal Actions and even then only when the card was updated from an action button on the card (with Action.Execute).

You can send content to Teams as a plain text message or an adaptive card - with adaptive cards you can use the new-ish universal action model as documented here: https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/universal-actions-for-adaptive-cards/overview?tabs=mobile.

This model exists to give you the chance to ensure that a card has the most up-to-date content when being viewed (even after closing and re-opening the chat using the "refresh model") and also allows you to display contextual content for the current user if you're in a group or channel chat... this seems to have the subjectively nice side effect that when you update the card using the InvokeResponse after submitting content (by implementing/overriding OnAdaptiveCardInvoke depending on your language of choice), even though you can send brand new card content as an attachment in the response which updates the card in-place, it doesn't say "Edited" and doesn't even change the timestamp on the message.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文