diff --git a/db/contacts_db.py b/db/contacts_db.py index 3dec4ad..8d87b71 100644 --- a/db/contacts_db.py +++ b/db/contacts_db.py @@ -627,12 +627,12 @@ class ContactsDBOperator(BaseDBOperator): return None #新增群信息删除功能 - def delete_chatroom_member_info(self, chatroom_id: str, wxid: str) -> bool: + def delete_chatroom_info(self, chatroom_id: str) -> bool: """删除群成员信息""" try: - sql = "DELETE FROM t_chatroom_member WHERE chatroom_id = %s AND wxid = %s" - self.execute_update(sql, (chatroom_id, wxid)) - self.LOG.info(f"成功删除群{chatroom_id}成员{wxid}信息") + sql = "DELETE FROM t_chatroom_member WHERE chatroom_id = %s" + self.execute_update(sql, (chatroom_id)) + self.LOG.info(f"成功删除群{chatroom_id}信息") sql = "DELETE FROM t_chatrooms WHERE chatroom_id = %s" self.execute_update(sql, (chatroom_id,)) self.LOG.info(f"成功删除群聊 {chatroom_id} 信息") diff --git a/robot.py b/robot.py index dc09dd4..4080c69 100644 --- a/robot.py +++ b/robot.py @@ -569,7 +569,7 @@ class Robot(Job): else: self.LOG.error(f"获取群 {group_id} 信息失败,证明用户无该群信息,删除群的相关资料。") # 删除群数据库中的群信息 - self.contacts_db.delete_chatroom_member_info(group_id) + self.contacts_db.delete_chatroom_info(group_id) self.LOG.info("联系人信息刷新完成") # ============================================== 业务内容==========================================================