mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 00:32:06 +08:00
修复web_ui群组无法获取,修复web_ui修改插件数据时cmd格式错误
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import copy
|
||||
from typing import List, Union, Dict, Callable
|
||||
from pathlib import Path
|
||||
from .models import BaseData, BaseGroup
|
||||
@@ -65,6 +66,9 @@ class GroupManager(StaticData):
|
||||
super().__init__(file, False)
|
||||
self._data = BaseData.parse_file(file) if file.exists() else BaseData()
|
||||
|
||||
def get_data(self) -> BaseData:
|
||||
return copy.deepcopy(self._data)
|
||||
|
||||
def block_plugin(self, module: str, group_id: int, is_save: bool = True):
|
||||
"""
|
||||
说明:
|
||||
@@ -340,6 +344,12 @@ class GroupManager(StaticData):
|
||||
with open(path, "w", encoding="utf8") as f:
|
||||
json.dump(dict_data, f, ensure_ascii=False, indent=4)
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
self._data.group_manager[key] = value
|
||||
|
||||
def __getitem__(self, key) -> BaseGroup:
|
||||
return self._data.group_manager[key]
|
||||
|
||||
# def get_super_old_data(self) -> Optional[dict]:
|
||||
# """
|
||||
# 说明:
|
||||
|
||||
Reference in New Issue
Block a user