feat: Add remove up function to datasource

This commit is contained in:
LWR 2023-06-18 00:32:05 +08:00
parent 4eb04801cd
commit dc9e2bdf48

View File

@ -55,6 +55,17 @@ class DataSource(metaclass=abc.ABCMeta):
"""
return self.__up_list
def remove_up(self, uid: int):
"""
从数据源中移除指定 UID UP 实例
Args:
uid: 需要移除 Up UID
"""
for bot in self.bots:
bot.ups = [up for up in bot.ups if up.uid != uid]
self.format_data()
def get_uid_list(self) -> List[int]:
"""
获取数据源中所有的 UID