当机器人在Microsoft Teams中发送自适应卡时更改通知文本



我正在用微软BotFramework开发一个机器人程序。当机器人程序发送自适应卡时,通知文本是"发送卡片";。

有没有办法修改这个文本?

是的,您可以使用"摘要";活动的属性。你可以继续尝试这个示例代码:

var response = MessageFactory.Text(string.Empty);
AdaptiveCard ad = new AdaptiveCard();
ad.Body = new List<AdaptiveElement>() {
new AdaptiveTextBlock()
{
Text= "testing",
Id ="testing"
}
};
Attachment att = new Attachment()
{
Content=ad,
ContentType= AdaptiveCard.ContentType
};
response.Attachments.Add(att);
response.Summary = "showing custom greeeting from the Bot - rather than send a card";
context.SendActivityAsync(response, cancellationToken);

最新更新