🐛 修复发送问题 (#649)

修复发送问题
This commit is contained in:
RBAmeto 2024-08-23 09:48:35 +08:00 committed by GitHub
parent cf54b6fd06
commit b8c5eb7915
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -193,13 +193,18 @@ async def onebot_send(
) )
) )
elif _c.type == 'node': elif _c.type == 'node':
await _send_node( messages = [
to_json( to_json(
await to_msg(_c.data), f'[CQ:image,file={_msg["data"]}]'
if _msg['type'] == 'image'
else _msg['data'],
'小助手', '小助手',
str(2854196310), str(2854196310),
) )
) for _msg in _c.data
if 'data' in _msg
]
await _send_node(messages)
elif _c.type == 'file': elif _c.type == 'file':
await to_file(_c.data) await to_file(_c.data)
elif _c.type == 'at': elif _c.type == 'at':
@ -207,6 +212,10 @@ async def onebot_send(
return message return message
result_msg = await to_msg(content) result_msg = await to_msg(content)
if result_msg:
result_msg = ''.join(result_msg)
else:
return
if target_type == 'group': if target_type == 'group':
await bot.send_group_msg( await bot.send_group_msg(
self_id=bot_self_id, self_id=bot_self_id,