【问题标题】:Bot Framework mentions in Teams for a channel stopped workingTeams 中提到的频道停止工作的 Bot Framework
【发布时间】:2020-02-25 20:29:42
【问题描述】:

我在 Microsoft Teams 中的 Bot 在下面的代码中提到了主动消息背后的频道。在上周,它已停止工作。是否对 API 进行了任何更改以防止这种情况发生?

var bot = new ChannelAccount(team.BotId);
string replyText = $"<at>@{teamName}</at> ";
Logger.LogInformation($"ReplyText:{replyText}");
var activity = MessageFactory.Text(replyText);

var mentioned = JObject.FromObject(new
{
    id = team.TeamId,
    name = teamName
});
var mentionedEntity = new Entity("mention")
{
    Properties = JObject.FromObject(new { mentioned = mentioned, text = replyText }),
};
// activity.Entities = new[] { mentionedEntity };
activity.Text = "It's time for the daily challenge " + replyText;
var convParams = new ConversationParameters()
{
    TenantId = team.TenantId,
    Bot = bot,
    IsGroup = true,
    ChannelData = team.ChannelData,
    Activity = activity
};

【问题讨论】:

    标签: botframework microsoft-teams


    【解决方案1】:

    您可以尝试在自适应卡片 json 中添加用户提及,如下所示。

    {
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "size": "Medium",
            "weight": "Bolder",
            "text": "Hi <at>Mungo</at> This is new feature in Adaptive Card version 1.2 Please test..."
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.0",
    "channelId": {
        "entities": [
            {
                "type": "mention",
                "text": "<at>Mungo</at>",
                "mentioned": {
                    "id": "29:124124124124",
                    "name": "Mungo"
                }
            }
        ]
    }
    

    }

    Here is a sample card

    【讨论】:

      猜你喜欢
      • 2020-12-17
      • 1970-01-01
      • 2017-09-26
      • 2020-09-05
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      相关资源
      最近更新 更多