From b8c5eb7915b1cae0607be92f414f80b678bb4e02 Mon Sep 17 00:00:00 2001 From: RBAmeto <46624927+RBAmeto@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:48:35 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E5=8F=91?= =?UTF-8?q?=E9=80=81=E9=97=AE=E9=A2=98=20(#649)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复发送问题 --- GenshinUID/client.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/GenshinUID/client.py b/GenshinUID/client.py index 3a851073..5affaa1c 100644 --- a/GenshinUID/client.py +++ b/GenshinUID/client.py @@ -193,13 +193,18 @@ async def onebot_send( ) ) elif _c.type == 'node': - await _send_node( + messages = [ to_json( - await to_msg(_c.data), + f'[CQ:image,file={_msg["data"]}]' + if _msg['type'] == 'image' + else _msg['data'], '小助手', str(2854196310), ) - ) + for _msg in _c.data + if 'data' in _msg + ] + await _send_node(messages) elif _c.type == 'file': await to_file(_c.data) elif _c.type == 'at': @@ -207,6 +212,10 @@ async def onebot_send( return message result_msg = await to_msg(content) + if result_msg: + result_msg = ''.join(result_msg) + else: + return if target_type == 'group': await bot.send_group_msg( self_id=bot_self_id,