Merge pull request #1012 from Zhenyi-Wang/master

feat: gewechat client增加获取通讯录列表接口
This commit is contained in:
Soulter
2025-03-29 17:51:35 +08:00
committed by GitHub
@@ -735,3 +735,20 @@ class SimpleGewechatClient:
json_blob = await resp.json()
logger.debug(f"获取群信息结果: {json_blob}")
return json_blob
async def get_contacts_list(self):
"""
获取通讯录列表
见 https://apifox.com/apidoc/shared/69ba62ca-cb7d-437e-85e4-6f3d3df271b1/api-196794504
"""
payload = {"appId": self.appid}
async with aiohttp.ClientSession() as session:
async with session.post(
f"{self.base_url}/contacts/fetchContactsList",
headers=self.headers,
json=payload,
) as resp:
json_blob = await resp.json()
logger.debug(f"获取通讯录列表结果: {json_blob}")
return json_blob