我有一个使用Microsoft Bot Framework构建的机器人(使用C#),我想在频道对话中提及一个团队或频道,您可以在将Microsoft Teams用作用户时进行操作。我可以提到一个用户,就像下面这样:
// I have previously created an Activity object called activity
var account = new ChannelAccount(accountId);
activity.AddMentionToText(account, MentionTextLocation.PrependText, "Firstname Lastname");
var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
var response = await connector.Conversations.SendToConversationAsync(activity);
显示为“ 姓氏邮件文本”
但是,当我尝试以相同的方式进行操作,但是使用小组或渠道ID时,该提及将不起作用。消息通过,但看起来像纯文本,例如:
“频道名称messageText”
var account = new ChannelAccount(channelId);
activity.AddMentionToText(account, MentionTextLocation.PrependText, "Channel Name");
var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
var response = await connector.Conversations.SendToConversationAsync(activity);
我想做的是可能的吗? 谢谢!