🐛 fix: 修复 gewechat 部分场景下下载图片报错 #700

This commit is contained in:
Soulter
2025-03-09 18:10:38 +08:00
parent 3eb49f7422
commit c38fa77ce6

View File

@@ -186,6 +186,11 @@ class SimpleGewechatClient:
abm.message_str = content
case 3:
# 图片消息
# 先看看 base64 数据
if "ImgBuf" in d and "buffer" in d["ImgBuf"]:
logger.debug("发现图片消息包含 base64 数据,使用。")
abm.message.append(Image.fromBase64(d["ImgBuf"]["buffer"]))
else:
file_url = await self.multimedia_downloader.download_image(
self.appid, content
)