Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python clients | 获取群成员接口无法获取群内已添加好友的企业微信对象的昵称的问题 #216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions clients/python/wcferry/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,9 @@ def get_chatroom_members(self, roomid: str) -> Dict:
Dict: 群成员列表: {wxid1: 昵称1, wxid2: 昵称2, ...}
"""
members = {}
contacts = self.query_sql("MicroMsg.db", "SELECT UserName, NickName FROM Contact;")
contacts = {contact["UserName"]: contact["NickName"]for contact in contacts}
query_contacts = self.query_sql("MicroMsg.db", "SELECT UserName, NickName FROM Contact;")
query_contacts = {contact["UserName"]: contact["NickName"] for contact in query_contacts}
contacts = {i['wxid']: i['name'] for i in self.get_contacts()} | query_contacts
crs = self.query_sql("MicroMsg.db", f"SELECT RoomData FROM ChatRoom WHERE ChatRoomName = '{roomid}';")
if not crs:
return members
Expand Down