diff --git a/app/endpoints/pipeline_endpoint.py b/app/endpoints/pipeline_endpoint.py index 6c276f7..ffd306c 100644 --- a/app/endpoints/pipeline_endpoint.py +++ b/app/endpoints/pipeline_endpoint.py @@ -75,7 +75,7 @@ async def get_messages(request: Request, body: Dict[str, Any]): async def handle_self_cmd_async(request: Request,wxid,msg): ''' 个人微信命令处理 - 如果是个人微信的指令,wxid == to_wxid + 如果是个人微信的指令,from_wxid == to_wxid commands = { '启用托管': True, '关闭托管': False @@ -374,21 +374,21 @@ async def handle_text_async(request: Request,token_id,app_id, wxid,msg_data,from return # 判断是否转人工处理功能 - is_human_handle_msg= await request.app.state.gewe_service.is_human_handle_msg_async(wxid) + is_human_handle_msg= await request.app.state.gewe_service.is_human_handle_msg_async(to_wxid) if is_human_handle_msg: - logger.warning(f'微信号 {wxid} 暂时工人接管30分钟中') + logger.warning(f'微信号 {wxid} 发送到微信号{to_wxid} 暂时工人接管30分钟中') return msg_content=msg_data["Content"]["string"] - if from_wxid == to_wxid: #手动发送消息 + if wxid == from_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]) callback_to_user=msg_data["ToUserName"]["string"] # 转人工处理功能 - await request.app.state.gewe_service.set_human_handle_msg_async(wxid,60*30) + await request.app.state.gewe_service.set_human_handle_msg_async(to_wxid,60*30) # 推送到kafka input_wx_content_dialogue_message=[{"type": "text", "text": msg_content}]