【问题标题】:Change notification text when bot sends an adaptive card in Microsoft Teams?bot 在 Microsoft Teams 中发送自适应卡时更改通知文本?
【发布时间】:2020-11-24 16:45:14
【问题描述】:

我正在使用 microsoft BotFramework 开发一个机器人。当机器人发送自适应卡片时,通知文本是“Sent a Card”。

有没有办法修改这段文字?

【问题讨论】:

标签: botframework microsoft-teams


【解决方案1】:

是的,您可以使用活动的“摘要”属性更改通知上的文本。 您可以继续尝试以下示例代码:

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);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-11
    • 2020-10-21
    • 2021-12-17
    相关资源
    最近更新 更多