Explorar el Código

调整

develop
H Vs hace 2 meses
padre
commit
4f9f9096aa
Se han modificado 1 ficheros con 13 adiciones y 3 borrados
  1. +13
    -3
      resources/messages_resource.py

+ 13
- 3
resources/messages_resource.py Ver fichero

@@ -98,7 +98,12 @@ class MessagesResource(Resource):
'''
wxid = msg.get("Wxid")
msg_data = msg.get("Data")
handle_mod_contacts(token_id,app_id,wxid,msg_data)
#
#handle_mod_contacts(token_id,app_id,wxid,msg_data)
#
threading.Thread(target=handle_mod_contacts, args=(token_id,app_id,wxid,msg_data)).start()

elif type_name=="DelContacts":
'''
删除好友通知/退出群聊
@@ -774,9 +779,14 @@ def handle_mod_contacts(token_id,app_id,wxid,msg_data):


ret,msg,contacts_list = gewe_chat.wxchat.fetch_contacts_list(token_id, app_id)
friend_wxids = contacts_list['friends'][3:] # 可以调整截取范围
print(friend_wxids)
# friend_wxids = contacts_list['friends'][3:] # 可以调整截取范围
# print(friend_wxids)
#friend_wxids.remove('fmessage')
#friend_wxids.remove('weixin')

friend_wxids = [c for c in contacts_list['friends'] if c not in ['fmessage', 'medianote','weixin']] # 可以调整截取范围
print(f'{wxid}的好友数量{len(friend_wxids)}')
gewe_chat.wxchat.save_contacts_brief_to_cache(token_id, app_id, wxid, friend_wxids)
else:


Cargando…
Cancelar
Guardar