perf: 结构化插件的表示格式; 优化插件开发接口

This commit is contained in:
Soulter
2024-03-12 18:50:50 +08:00
parent 1af481f5f9
commit e643eea365
22 changed files with 457 additions and 215 deletions
-2
View File
@@ -1,4 +1,3 @@
from cores.qqbot.global_object import GlobalObject
from typing import Union
import os
import json
@@ -19,7 +18,6 @@ def load_config(namespace: str) -> Union[dict, bool]:
ret[k] = data[k]["value"]
return ret
def put_config(namespace: str, name: str, key: str, value, description: str):
'''
将配置项写入以namespace为名字的配置文件,如果key不存在于目标配置文件中。当前 value 仅支持 str, int, float, bool, list 类型(暂不支持 dict)。