diff --git a/robot.py b/robot.py index ab19e5d..0cf73f5 100644 --- a/robot.py +++ b/robot.py @@ -454,13 +454,6 @@ class Robot: while True: time.sleep(1) - # 添加一个方法用于刷新联系人信息 - async def refresh_contacts(self): - """刷新联系人信息""" - self.allContacts = self.get_all_contacts() - friends = await self.ipad_bot.get_contract_list() - self.contact_manager.refresh_contacts(self.allContacts, friends) - self.LOG.info("联系人信息已刷新") async def send_group_txt_message(self, msg: str, feature: Feature): """向所有启用了特定功能的群发送文本消息""" diff --git a/utils/wechat/contact_manager.py b/utils/wechat/contact_manager.py index d58053e..464ae65 100644 --- a/utils/wechat/contact_manager.py +++ b/utils/wechat/contact_manager.py @@ -257,28 +257,6 @@ class ContactManager: self._personal_contacts[wxid] = nickname self._logger.debug(f"已更新联系人: {wxid} -> {nickname}") - def refresh_contacts(self, new_contacts: Dict[str, str], friends: List[str]) -> None: - """刷新联系人信息 - - Args: - new_contacts: 新的联系人字典 - friends: 联系人信息,格式为 ["wxid","wxid2"] - - """ - self._contacts = new_contacts - self._friends = friends - # friends: 好友清单 contact = { - # "wxid": cnt.get("wxid", ""), - # "code": cnt.get("code", ""), - # "remark": cnt.get("remark", ""), - # "name": cnt.get("name", ""), - # "country": cnt.get("country", ""), - # "province": cnt.get("province", ""), - # "city": cnt.get("city", ""), - # "gender": gender} - self._logger.info(f"联系人信息已刷新,共 {len(new_contacts)} 个联系人") - self._classify_contacts() - def get_contact_statistics(self) -> Tuple[int, int, int, int, int]: """获取联系人统计信息