From 133e48a5a988eceeb5f2a233409a591951184712 Mon Sep 17 00:00:00 2001 From: Dong_master <2213070223@qq.com> Date: Wed, 26 Feb 2025 02:54:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?'=E4=B8=AA=E4=BA=BA=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E4=B8=AD=E4=B8=BB=E5=8A=A8=E5=8F=91=E9=80=81=E4=BF=A1=E6=81=AF?= =?UTF-8?q?send=5Fmessage=E7=9A=84=E4=BF=AE=E6=94=B9'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/platform/sources/gewechat.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/platform/sources/gewechat.py b/pkg/platform/sources/gewechat.py index 1b620243..71ea7066 100644 --- a/pkg/platform/sources/gewechat.py +++ b/pkg/platform/sources/gewechat.py @@ -238,7 +238,15 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter): target_id: str, message: platform_message.MessageChain ): - pass + geweap_msg = await GewechatMessageConverter.yiri2target(message) + + for msg in geweap_msg: + if msg['type'] == 'text': + + if target_type == "group": + await self.bot.post_text(app_id=self.config['app_id'], to_wxid=target_id,content=msg['content']) + elif target_type == "person": + await self.bot.post_text(app_id=self.config['app_id'], to_wxid=target_id,content=msg['content']) async def reply_message( self, From 998ad7623c39cf8e9587c6433ef24c469637f850 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Wed, 26 Feb 2025 15:53:26 +0800 Subject: [PATCH 2/2] perf(gewechat): simplify --- pkg/platform/sources/gewechat.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/platform/sources/gewechat.py b/pkg/platform/sources/gewechat.py index 71ea7066..3f53f802 100644 --- a/pkg/platform/sources/gewechat.py +++ b/pkg/platform/sources/gewechat.py @@ -242,11 +242,7 @@ class GeWeChatAdapter(adapter.MessagePlatformAdapter): for msg in geweap_msg: if msg['type'] == 'text': - - if target_type == "group": - await self.bot.post_text(app_id=self.config['app_id'], to_wxid=target_id,content=msg['content']) - elif target_type == "person": - await self.bot.post_text(app_id=self.config['app_id'], to_wxid=target_id,content=msg['content']) + await self.bot.post_text(app_id=self.config['app_id'], to_wxid=target_id,content=msg['content']) async def reply_message( self,