修复群聊数据无法初始化

This commit is contained in:
HibiKier
2023-05-28 22:57:18 +08:00
parent e4ca110938
commit 7b0785248c
3 changed files with 20 additions and 19 deletions
+5 -3
View File
@@ -35,9 +35,11 @@ def init_group(func: Callable):
def wrapper(*args, **kwargs):
self = args[0]
group_id = list(filter(lambda x: is_number(x), args[1:]))[0]
if self is not None and group_id and not self._data.group_manager.get(group_id):
self._data.group_manager[group_id] = BaseGroup()
if arg_list := list(filter(lambda x: is_number(x), args[1:])):
group_id = str(arg_list[0])
if self is not None and group_id and not self._data.group_manager.get(group_id):
self._data.group_manager[group_id] = BaseGroup()
self.save()
return func(*args, **kwargs)
return wrapper