添加 刷新通讯录功能,用于解决冗余数据问题。

This commit is contained in:
liuwei
2025-05-07 12:06:50 +08:00
parent f0835868df
commit 5bcb12ce91
2 changed files with 16 additions and 16 deletions

View File

@@ -99,15 +99,15 @@ class FriendMixin(WechatAPIClientBase):
else:
self.error_handler(json_resp)
async def get_contract_list(self, wx_seq: int = 0, chatroom_seq: int = 0) -> dict:
"""获取联系人列表
async def get_contract_list(self, wx_seq: int = 0, chatroom_seq: int = 0) -> list:
"""获取联系人用户名列表
Args:
wx_seq: 联系人序列
chatroom_seq: 群聊序列
Returns:
dict: 联系人列表数据
list: 联系人用户名列表
"""
if not self.wxid:
raise UserLoggedOut("请先登录")
@@ -118,7 +118,8 @@ class FriendMixin(WechatAPIClientBase):
json_resp = await response.json()
if json_resp.get("Success"):
return json_resp.get("Data")
# 直接返回联系人用户名列表
return json_resp.get("Data").get("ContactUsernameList", [])
else:
self.error_handler(json_resp)