fix image

pull/65/head
foxplaying 2025-10-25 04:41:13 +08:00 committed by GitHub
parent be79ceab9f
commit 1e35ab8fa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -623,6 +623,7 @@ class MessageHandler:
"""
message_data: dict = raw_message.get("data")
image_sub_type = message_data.get("sub_type")
file = message_data.get("file", "")
summary = message_data.get("summary", "")
try:
image_base64 = await get_image_base64(message_data.get("url"))
@ -633,10 +634,7 @@ class MessageHandler:
if summary:
return Seg(type="text", data=f"[表情包:{summary}]")
return None
if "动画表情" in summary:
"""将动画表情视为表情包,防止报错"""
return Seg(type="emoji", data=image_base64)
if image_sub_type == 0:
if image_sub_type == 0 and not file.lower().endswith(".gif"):
"""这部分认为是图片"""
return Seg(type="image", data=image_base64)
elif image_sub_type not in [4, 9]: