Sending animated GIFs with sendPhoto (Telegram bot)

m52go picture m52go · Dec 15, 2016 · Viewed 13.8k times · Source

I'm trying to send an animated GIF with sendPhoto (Telegram's Bot API) with this request:

https://api.telegram.org/bot<token>/sendPhoto?chat_id=<chat_id>&photo=http://i.giphy.com/13IC4LVeP5NGNi.gif

That method works, as in, I get ok:true back, but the image in the chat window is a still snapshot of the moving GIF.

How can I get the animated GIF to show? Is there another method I should use?

Answer

Maak picture Maak · Dec 15, 2016

You should use the sendAnimation method for sending a GIF or H.264/MPEG-4 AVC video without sound.
Just use the animation parameter for your GIF file.


sendPhoto is only used for static images.