From 5e449be9f2a06973d38ea8351f4fbafc9f908d96 Mon Sep 17 00:00:00 2001 From: H Vs Date: Mon, 21 Apr 2025 17:59:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/endpoints/pipeline_endpoint.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/endpoints/pipeline_endpoint.py b/app/endpoints/pipeline_endpoint.py index c9a54bf..6c276f7 100644 --- a/app/endpoints/pipeline_endpoint.py +++ b/app/endpoints/pipeline_endpoint.py @@ -83,8 +83,9 @@ async def handle_self_cmd_async(request: Request,wxid,msg): ''' msg_data=msg.get("Data") to_wxid=msg_data["ToUserName"]["string"] + from_wxid=msg_data["FromUserName"]["string"] msg_content=msg_data["Content"]["string"] - if wxid == to_wxid: + if from_wxid == to_wxid: commands = { '启用托管': True, '关闭托管': False @@ -381,7 +382,7 @@ async def handle_text_async(request: Request,token_id,app_id, wxid,msg_data,from msg_content=msg_data["Content"]["string"] - if wxid == to_wxid: #手动发送消息 + if from_wxid == to_wxid: #手动发送消息 logger.info("Active message sending detected") await request.app.state.gewe_service.save_contacts_brief_to_cache_async(token_id,app_id,wxid,[to_wxid]) @@ -678,7 +679,7 @@ async def handle_text_group_async(request: Request,token_id,app_id, wxid,msg_dat logger.warning(f"微信号 {wxid} 关闭好友和群自动回复功能,{handle_text_group_async.__name__} 不回复消息") return - if wxid == to_wxid: #手动发送消息 + if from_wxid == to_wxid: #手动发送消息 logger.info("Active message sending detected") await request.app.state.gewe_service.save_contacts_brief_to_cache_async(token_id,app_id,wxid,[to_wxid])