From b49b7e963d83599054ff702def87e4aa0a0ea41e Mon Sep 17 00:00:00 2001 From: Dong_master <2213070223@qq.com> Date: Wed, 5 Mar 2025 00:54:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E4=BA=86gewe=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=9B=9E=E8=B0=83=E5=8F=82=E6=95=B0data=E5=92=8Ctypen?= =?UTF-8?q?ame=E5=AD=97=E6=AE=B5=E6=94=B9=E5=8F=98=E9=80=A0=E6=88=90?= =?UTF-8?q?=E7=9A=84=E4=B8=8D=E5=9B=9E=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/platform/sources/gewechat.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/platform/sources/gewechat.py b/pkg/platform/sources/gewechat.py index 5f8588bb..e14d424f 100644 --- a/pkg/platform/sources/gewechat.py +++ b/pkg/platform/sources/gewechat.py @@ -226,11 +226,16 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter): @self.quart_app.route('/gewechat/callback', methods=['POST']) async def gewechat_callback(): data = await quart.request.json - # print(json.dumps(data, indent=4, ensure_ascii=False)) + + + if data['data']: + data['Data'] = data['data'] + print(json.dumps(data, indent=4, ensure_ascii=False)) + if 'testMsg' in data: return 'ok' - elif 'TypeName' in data and data['TypeName'] == 'AddMsg': + elif 'TypeName' in data and data['TypeName'] or data['type_name'] == 'AddMsg': try: event = await self.event_converter.target2yiri(data.copy(), self.bot_account_id) @@ -248,7 +253,7 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter): target_id: str, message: platform_message.MessageChain ): - geweap_msg = await GewechatMessageConverter.yiri2target(message) + geweap_msg = await self.message_converter.yiri2target(message) # 此处加上群消息at处理 # ats = [item["target"] for item in geweap_msg if item["type"] == "at"] From 1932444666e629849c34bd822d8beb799d7569cb Mon Sep 17 00:00:00 2001 From: Dong_master <2213070223@qq.com> Date: Wed, 5 Mar 2025 16:48:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E4=BA=86gewe=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=9B=9E=E8=B0=83=E5=8F=82=E6=95=B0data=E5=92=8Ctypen?= =?UTF-8?q?ame=E5=AD=97=E6=AE=B5=E6=94=B9=E5=8F=98=E9=80=A0=E6=88=90?= =?UTF-8?q?=E7=9A=84=E4=B8=8D=E5=9B=9E=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/platform/sources/gewechat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/platform/sources/gewechat.py b/pkg/platform/sources/gewechat.py index e14d424f..af343e97 100644 --- a/pkg/platform/sources/gewechat.py +++ b/pkg/platform/sources/gewechat.py @@ -230,7 +230,7 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter): if data['data']: data['Data'] = data['data'] - print(json.dumps(data, indent=4, ensure_ascii=False)) + # print(json.dumps(data, indent=4, ensure_ascii=False)) if 'testMsg' in data: