【发布时间】:2022-06-10 19:13:23
【问题描述】:
这些天我们开始看到一个奇怪的问题。自适应卡片在频道的预览模式下不可见,但在聊天中可见。我测试了一张只有一个文本的最低自适应卡片,我看到了相同的行为。
在聊天中
在频道中:
它的空白 完全地。但是当您点击发送时,卡片会完美地发布到 Chat 中。
这是代码:
import { Attachment, CardFactory } from "botbuilder";
export class CustomerResultCard {
public static getCard(type: string): Attachment {
const card = CardFactory.adaptiveCard(
{
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "Large",
"weight": "Bolder",
"text": "Entity Type:" +type+ " not supported",
"height": "stretch"
}
],
"height": "stretch",
"style": "default",
"width": 65
}
],
"height": "stretch"
}
],
"style": "default"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3"
}
);
return card;
}
}
【问题讨论】:
-
注意:这是关于消息扩展
-
能否分享一下重现步骤或您正在使用的示例?
-
我更新了上面的代码。我正在使用 Teams Toolkit 创建此搜索消息扩展。部署后,在 Chat 上运行完美。我可以在 Message 框中看到预览,但在 Channel 中,我看不到任何预览。当我选择搜索结果时,消息框中会闪烁并添加一个空格。当我点击发送时,卡片会发布到频道的聊天中。
-
@user25879 - 我们能够重现这个问题,我们已经提出了同样的错误。
标签: microsoft-teams adaptive-cards teams-toolkit