nonebot / nonebot/adapter-telegram

如何发送gif动图?

Open
#54 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
74
Forks
15
PR merge metrics
No merged PRs in 30d

Description

使用File.photo(bytes)构造的消息段发送后是静态图片
使用File.animation(bytes)构造的消息段发送后会变成document文件
使用File.animation(("xxxx.gif",bytes))构造的消息端发送后虽然能播放,但是格式变为了mp4,后缀名变为了xxx.gif.mp4
如何通过消息段正确的发送gif图片?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how File.photo(bytes), File.animation(bytes), and File.animation(("xxxx.gif", bytes)) are handled by the Telegram adapter. Check the resulting upload type, playback behavior, and filename; done means a GIF sent through a message segment remains a GIF rather than becoming a static image, document, or MP4.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.