|
|
@@ -418,13 +418,23 @@ async def handle_text_async(request: Request,token_id,app_id, wxid,msg_data,from |
|
|
|
18664262743 |
|
|
|
wxid_9pocbage7cdb22 |
|
|
|
''' |
|
|
|
|
|
|
|
''' |
|
|
|
测试环境的商机提醒使用:15986163393,wxid_488eunhhppbs22 |
|
|
|
''' |
|
|
|
contacts_brief= await request.app.state.gewe_service.get_contacts_brief_from_cache_async(wxid) |
|
|
|
|
|
|
|
contact_nick_name=next(filter(lambda x:x.get("userName") == callback_to_user,contacts_brief),{}).get("nickName","") |
|
|
|
assistant_msg_content=f'AI管家转人工提醒:【{contact_nick_name}】有{found_keywords[0]}需求' |
|
|
|
await request.app.state.gewe_service.post_text_async(token_id, app_id, 'wxid_9pocbage7cdb22', assistant_msg_content) |
|
|
|
|
|
|
|
biz_assistant_wxid="wxid_9pocbage7cdb22" |
|
|
|
environment = os.environ.get('environment', 'default') |
|
|
|
if environment=='test': |
|
|
|
biz_assistant_wxid='wxid_488eunhhppbs22' |
|
|
|
|
|
|
|
await request.app.state.gewe_service.post_text_async(token_id, app_id, biz_assistant_wxid, assistant_msg_content) |
|
|
|
|
|
|
|
k,loginfo=await request.app.state.gewe_service.get_login_info_by_wxid_async('wxid_9pocbage7cdb22') |
|
|
|
k,loginfo=await request.app.state.gewe_service.get_login_info_by_wxid_async(biz_assistant_wxid) |
|
|
|
if not k: |
|
|
|
logger.warning(f'助理微信号 wxid_9pocbage7cdb22 不存在') |
|
|
|
return |
|
|
@@ -1162,12 +1172,13 @@ async def handle_xml_async(request: Request,token_id,app_id, wxid,msg_data,from_ |
|
|
|
handlers = { |
|
|
|
57: handle_xml_reference_async, |
|
|
|
5: handle_xml_invite_group_async, |
|
|
|
74: handle_file_message_async |
|
|
|
74: handle_file_message_async #直发 |
|
|
|
|
|
|
|
} |
|
|
|
# 判断是否为群 |
|
|
|
if check_chatroom(from_wxid) or check_chatroom(to_wxid): |
|
|
|
handlers[74]=handle_file_message_group_async |
|
|
|
|
|
|
|
|
|
|
|
handler = handlers.get(type_value) |
|
|
|
if handler: |
|
|
|
return await handler(request,token_id,app_id, wxid,msg_data,from_wxid, to_wxid) |
|
|
|