Microsoft Teams bot - 调试链接展开 [英] Microsoft Teams bot - debug link unfurling

查看:128
本文介绍了Microsoft Teams bot - 调试链接展开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现非常简单的团队机器人,但不断面临行为不可预测的问题.例如.文档 清楚地表明 Teams 应用自适应卡作为链接展开响应,但是当我发送非常简单的响应时,例如:

I'm trying to implement pretty simple teams bot but constantly facing an issues with unpredictable behavior. E.g. documentation clearly says that Teams applies Adaptive card as link unfurling response but when I'm sending pretty simple response like:

var card = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0));
card.Body.Add(new AdaptiveTextBlock { Text = "Title", Size = AdaptiveTextSize.ExtraLarge });
var attachment = new MessagingExtensionAttachment { ContentType = AdaptiveCard.ContentType, Content = card };
var result = new MessagingExtensionResult(AttachmentLayoutTypes.List, "result", new[] { attachment });
return new MessagingExtensionResponse(result);

Teams 不会呈现任何内容或退回到默认行为.所以问题是 - 有没有办法调试它为什么不起作用?

Teams doesn't render anything or follback to the default behavior. So the question is - are there any way to debug why it doesn't work?

推荐答案

一种简单的方法来了解正在发生的事情以及您的部分是否正常,是发送一张完整的静态"卡片作为测试.只需在某处创建 JSON 布局,加载它并将其原封不动地发送到 MS Teams.

one easy way to find out what's going on and if your part is generally ok is by sending a full "static" card as a test. Just create the JSON layout somewhere, load it and sent it unchanged to MS Teams.

同样创建 AdaptiveCard 并不是最好的方法,请查看 https://docs.microsoft.com/en-us/adaptive-cards/templating/ 处理这样的卡片要容易得多.

Also creating AdaptiveCard's like that is not the best way to do it, have a look at https://docs.microsoft.com/en-us/adaptive-cards/templating/ its a lot easier to handle cards like that.

针对您的问题,没有真正的方法可以调试 ms 团队内部的任何内容.您可能会在机器人框架的分析部分遇到一些错误,有时浏览器的控制台输出会提供一些提示.

Specific to your question there's no real way to debug anything inside ms teams. You can get a few errors in the analytics part of the bot framework and some times console output of your browser gives a few hints.

我前段时间写了一个类似的东西,它在特定的链接上插入一张卡片,类似于您正在尝试做的事情,并且一般来说,这曾经(现在仍然)工作正常.

I wrote a similar thing some time ago which inserts a card on specific links similar to what you're trying to do and generally, that was (and still is) working fine.

这篇关于Microsoft Teams bot - 调试链接展开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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