Sending animated GIFs using sendPhoto (telegram bot)

I am trying to send an animated GIF using sendPhoto (Telegram Bot API) with this request:

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

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

How can I show an animated GIF? Is there any other method I should use?

+7
source share
3 answers

You must use the sendAnimation method to send GIF or H.264 / MPEG-4 AVC videos without sound.
Just use the animation parameter for your GIF file.


sendPhoto used only for still images.

+15
source

use the sendVideo method!

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

it will work

+7
source

The sendAnimation method is by far the best option.

0
source

Source: https://habr.com/ru/post/1013201/


All Articles