diff --git a/astrbot/core/platform/sources/gewechat/client.py b/astrbot/core/platform/sources/gewechat/client.py index abab1790b..ccecc0c71 100644 --- a/astrbot/core/platform/sources/gewechat/client.py +++ b/astrbot/core/platform/sources/gewechat/client.py @@ -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