From dd30b640045d56b031e2eeeb97620ce88164c16c Mon Sep 17 00:00:00 2001 From: snowy Date: Fri, 29 Mar 2024 15:12:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=85=8D=E7=BD=AE=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=9A=84=E7=83=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 8933281..f8ac7b0 100644 --- a/main.py +++ b/main.py @@ -1,11 +1,19 @@ import nonebot from nonebot.adapters.onebot import v11, v12 -from liteyuki.utils.config import config, load_from_yaml + from liteyuki.utils import init +from liteyuki.utils.config import load_from_yaml +from liteyuki.utils.data_manager import StoredConfig, common_db from liteyuki.utils.liteyuki_api import liteyuki_api init() -nonebot.init(**load_from_yaml("config.yml")) + +store_config: dict = common_db.first(StoredConfig(), default=StoredConfig()).config +print("Stored config loaded.", store_config) + +static_config = load_from_yaml("config.yml") +store_config.update(static_config) +nonebot.init(**store_config) adapters = [v11.Adapter, v12.Adapter] driver = nonebot.get_driver()