mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 11:42:44 +08:00
Fixed aiocqhttp mirai.Voice类型无法正确传递url及base64的异常
This commit is contained in:
parent
dd1cec70c0
commit
221b310485
|
@ -47,7 +47,16 @@ class AiocqhttpMessageConverter(adapter.MessageConverter):
|
||||||
elif type(msg) is mirai.Face:
|
elif type(msg) is mirai.Face:
|
||||||
msg_list.append(aiocqhttp.MessageSegment.face(msg.face_id))
|
msg_list.append(aiocqhttp.MessageSegment.face(msg.face_id))
|
||||||
elif type(msg) is mirai.Voice:
|
elif type(msg) is mirai.Voice:
|
||||||
msg_list.append(aiocqhttp.MessageSegment.record(msg.path))
|
arg = ''
|
||||||
|
if msg.base64:
|
||||||
|
arg = msg.base64
|
||||||
|
msg_list.append(aiocqhttp.MessageSegment.record(f"base64://{arg}"))
|
||||||
|
elif msg.url:
|
||||||
|
arg = msg.url
|
||||||
|
msg_list.append(aiocqhttp.MessageSegment.record(arg))
|
||||||
|
elif msg.path:
|
||||||
|
arg = msg.path
|
||||||
|
msg_list.append(aiocqhttp.MessageSegment.record(msg.path))
|
||||||
elif type(msg) is forward.Forward:
|
elif type(msg) is forward.Forward:
|
||||||
|
|
||||||
for node in msg.node_list:
|
for node in msg.node_list:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user