使用 sendPhoto(电报机器人)发送动画 GIF [英] Sending animated GIFs with sendPhoto (Telegram bot)

查看:80
本文介绍了使用 sendPhoto(电报机器人)发送动画 GIF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过此请求发送带有 sendPhoto(Telegram 的 Bot API)的动画 GIF:

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

该方法有效,例如,我返回 ok:true,但聊天窗口中的图像是移动 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.

如何才能显示动画 GIF?我应该使用另一种方法吗?

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

推荐答案

你应该使用 sendAnimation 发送 GIF 或 H.264/MPEG-4 AVC 无声视频的方法.
只需为您的 GIF 文件使用 animation 参数即可.

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 仅用于静态图像.

这篇关于使用 sendPhoto(电报机器人)发送动画 GIF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆