File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 3131RUNNER = """import json
3232import os
3333
34- from nonebot import init, load_plugin, require
34+ from nonebot import init, load_plugin, require, logger
3535from pydantic import BaseModel
3636
3737
@@ -59,12 +59,8 @@ def default(self, obj):
5959 with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf8") as f:
6060 f.write(f"METADATA<<EOF\\ n{{json.dumps(metadata, cls=SetEncoder)}}\\ nEOF\\ n")
6161
62- try:
63- if plugin.metadata.config and not issubclass(plugin.metadata.config, BaseModel):
64- print("插件配置项不是 Pydantic BaseModel 的子类")
65- exit(1)
66- except TypeError:
67- print("插件配置项应该为 Pydantic BaseModel 子类而不是实例")
62+ if plugin.metadata.config and not issubclass(plugin.metadata.config, BaseModel):
63+ logger.error("插件配置项不是 Pydantic BaseModel 的子类")
6864 exit(1)
6965
7066{}
You can’t perform that action at this time.
0 commit comments