Merge pull request #779 from jerryliang122/master

修复aiocqhttp的图片错误
This commit is contained in:
Junyan Qin 2024-05-17 17:05:58 +08:00 committed by GitHub
commit c92d47bb95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,13 +31,15 @@ class AiocqhttpMessageConverter(adapter.MessageConverter):
msg_time = msg.time
elif type(msg) is mirai.Image:
arg = ''
if msg.url:
if msg.base64:
arg = msg.base64
msg_list.append(aiocqhttp.MessageSegment.image(f"base64://{arg}"))
elif msg.url:
arg = msg.url
msg_list.append(aiocqhttp.MessageSegment.image(arg))
elif msg.path:
arg = msg.path
msg_list.append(aiocqhttp.MessageSegment.image(arg))
msg_list.append(aiocqhttp.MessageSegment.image(arg))
elif type(msg) is mirai.At:
msg_list.append(aiocqhttp.MessageSegment.at(msg.target))
elif type(msg) is mirai.AtAll: