diff options
Diffstat (limited to 'ATRI/__init__.py')
-rw-r--r-- | ATRI/__init__.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ATRI/__init__.py b/ATRI/__init__.py index 79157ce..547e4bd 100644 --- a/ATRI/__init__.py +++ b/ATRI/__init__.py @@ -1,11 +1,16 @@ from time import sleep +from pathlib import Path import nonebot from nonebot.adapters.onebot.v11 import Adapter -from .config import RUNTIME_CONFIG, BotSelfConfig, InlineGoCQHTTP +from .configs import Config __version__ = "YHN-001-A07" +__conf_path = Path(".") / "config.yml" +__conf = Config(__conf_path) + +conf = __conf.parse() def asgi(): @@ -17,15 +22,15 @@ def driver(): def init(): - nonebot.init(**RUNTIME_CONFIG) + nonebot.init(**__conf.get_runtime_conf()) driver().register_adapter(Adapter) nonebot.load_plugins("ATRI/plugins") nonebot.load_plugins("ATRI/plugins/rss") - if InlineGoCQHTTP.enabled: + if conf.WithGoCQHTTP.enabled: nonebot.load_plugin("nonebot_plugin_gocqhttp") sleep(3) def run(): - log_level = "debug" if BotSelfConfig.debug else "warning" + log_level = "debug" if conf.BotConfig.debug else "warning" nonebot.run(log_level=log_level) |