Config提供type字段确定配置项类型

This commit is contained in:
HibiKier
2023-02-26 22:17:26 +08:00
parent a63fda8a0d
commit 8133b61ebd
53 changed files with 1589 additions and 1000 deletions
+10 -2
View File
@@ -1,3 +1,5 @@
from typing import List
from nonebot import on_message
from nonebot.adapters.onebot.v11 import Bot, GroupMessageEvent, Message, MessageEvent
from nonebot.rule import to_me
@@ -22,12 +24,18 @@ __plugin_settings__ = {
"cmd": ["Ai", "ai", "AI", "aI"],
}
__plugin_configs__ = {
"TL_KEY": {"value": [], "help": "图灵Key"},
"ALAPI_AI_CHECK": {"value": False, "help": "是否检测青云客骂娘回复", "default_value": False},
"TL_KEY": {"value": [], "help": "图灵Key", "type": List[str]},
"ALAPI_AI_CHECK": {
"value": False,
"help": "是否检测青云客骂娘回复",
"default_value": False,
"type": bool,
},
"TEXT_FILTER": {
"value": ["鸡", "口交"],
"help": "文本过滤器,将敏感词更改为*",
"default_value": [],
"type": List[str],
},
}
Config.add_plugin_config(