mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
通过base64编码发送,修复cqhttp无法发送图片
This commit is contained in:
@@ -31,13 +31,15 @@ class AiocqhttpMessageConverter(adapter.MessageConverter):
|
||||
msg_time = msg.time
|
||||
elif type(msg) is mirai.Image:
|
||||
arg = ''
|
||||
|
||||
if msg.url:
|
||||
if hasattr(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:
|
||||
|
||||
Reference in New Issue
Block a user