Gif图像不能在Microsoft Teams中播放

时间:2016-12-21 12:30:34

标签: c# botframework botconnector microsoft-teams

我使用以下代码在我的回复中将gif图像显示为附件:

    Activity replyToConversation = (Activity)context.MakeMessage();
    replyToConversation.Attachments = new List<Attachment>();
    replyToConversation.Attachments.Add(new Attachment()
    {
       ContentUrl = "http://i.giphy.com/p3BDz27c5RlIs.gif",
       ContentType = "image/gif"
    });

    await context.PostAsync(replyToConversation);
    context.Wait(MessageReceivedAsync);

在Web Chat频道中,它按预期显示(和播放),但由于某种原因,它在Microsoft Teams频道中显示为静态图像。

请,任何想法?

2 个答案:

答案 0 :(得分:4)

作为一种变通方法,您可以返回嵌套图像的HTML字符串

 await context.PostAsync($"<img src=\"{imageUrl}\" />");

答案 1 :(得分:2)

对不起,Bots in Teams目前不支持动画GIF,内联或卡片。有关当前支持的功能子集,请参阅MSDN documentation