Gif images don't play in Microsoft Teams

9.1k views Asked by At

I'm using the following code to display a gif image as an attachment in my reply:

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

In the Web Chat channel it displays (and play) as expected, but for some reason it displays as a static image in the Microsoft Teams channel.

Please, any ideas?

2

There are 2 answers

2
Rich Moe - Microsoft On BEST ANSWER

Sorry, Bots in Teams currently don't support animated GIFs, inline or in cards. See the MSDN documentation for the subset of functionality currently supported

1
Michael C On

As a workaround you can return an HTML string nesting the image

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