[英]How to change notification text when bot sends an adaptive card in Microsoft Teams?
我正在使用 Microsoft BotFramework 開發一個機器人,目前在 Microsoft Teams 中使用它。
當 bot 發送自適應卡片時,Microsoft Teams 通知文本始終相同,土耳其語為“Bir kart gönder”,英文翻譯可能是“Sent a card”。
有沒有辦法修改這個文本?
有些通知很重要,應立即處理,有些則不重要。 如果我可以更改通知文本,我的用戶將不必打開對話即可查看所有消息的通知。
var response = MessageFactory.Text(string.Empty);
response.Attachments.Add(cardAttachment);
response.Summary = "showing custom greeeting from the Bot - rather than a card";
await turnContext.SendActivityAsync(response, cancellationToken);
//一旦我們添加了摘要機器人將不會在團隊中顯示“已發送卡片”消息,即使在通知中我們也不會看到“已發送卡片”,我們會得到摘要。
您可以添加短信:
const activity = {
attachments: [adaptiveCard],
text: "your message"
};
這個解決方案的丑陋之處在於,用戶會收到兩個通知:一個是消息,另一個是“Sent a card”
目前,bot 發送消息時顯示的默認通知是“[BotName] sent a card”。無法更改此消息。 但是,如果您的機器人發送普通短信,您可以向其添加通知消息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.