无法在 Teams 的自适应卡中显示超过 6 个自适应操作
Cannot display more than 6 adaptive actions in an Adaptive card in Teams
我是 bot 框架和 c# 的新手 - 我们使用 QnA maker 知识库实现了一个 bot。我正在尝试将自适应卡片与自适应提交操作结合使用。
WebChat 中一切正常,但在 Teams 中我无法同时显示超过 6 个提交操作...
请在下面找到测试代码:
var demoActionList = new List<AdaptiveAction>();
for (int i=0; i<20; i++)
{
demoActionList.Add(
new AdaptiveSubmitAction()
{
Type = "Action.Submit",
Title = "title + "+i,
Data = new QnABot.Dialog.MsTeamsDataResponseWrapper() { MsTeamsResponse = new QnABot.Dialog.MsTeamsResponse() { Value = "title + " + i } }
});
}
var plCard = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0));
plCard.Actions = demoActionList;
var attachment = new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Content = plCard
};
chatActivity.Attachments.Add(attachment);
如果我 运行 在网络聊天中使用此代码,我将在自适应卡片中看到所有 20 个提交操作,但在 ms teams 中我只能看到 6
请参阅团队示例, and the example with the webchat
知道如何使用 ms teams 在卡片中显示所有提交操作吗?
这是 Teams 中目前已知的硬性限制 - 请参阅不久前 Microsoft 某人的回答: 其中包括一些建议的解决方法。
更新:我也想知道 list cards 是否有兴趣 - 它看起来有点类似于您上面显示的网络聊天示例 - 基本上是一长串选项。
Teams does support carousels, so you could have multiple card attachments in a single activity like this.
我是 bot 框架和 c# 的新手 - 我们使用 QnA maker 知识库实现了一个 bot。我正在尝试将自适应卡片与自适应提交操作结合使用。
WebChat 中一切正常,但在 Teams 中我无法同时显示超过 6 个提交操作...
请在下面找到测试代码:
var demoActionList = new List<AdaptiveAction>();
for (int i=0; i<20; i++)
{
demoActionList.Add(
new AdaptiveSubmitAction()
{
Type = "Action.Submit",
Title = "title + "+i,
Data = new QnABot.Dialog.MsTeamsDataResponseWrapper() { MsTeamsResponse = new QnABot.Dialog.MsTeamsResponse() { Value = "title + " + i } }
});
}
var plCard = new AdaptiveCard(new AdaptiveSchemaVersion(1, 0));
plCard.Actions = demoActionList;
var attachment = new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Content = plCard
};
chatActivity.Attachments.Add(attachment);
如果我 运行 在网络聊天中使用此代码,我将在自适应卡片中看到所有 20 个提交操作,但在 ms teams 中我只能看到 6
请参阅团队示例
知道如何使用 ms teams 在卡片中显示所有提交操作吗?
这是 Teams 中目前已知的硬性限制 - 请参阅不久前 Microsoft 某人的回答:
更新:我也想知道 list cards 是否有兴趣 - 它看起来有点类似于您上面显示的网络聊天示例 - 基本上是一长串选项。
Teams does support carousels, so you could have multiple card attachments in a single activity like this.