feat: 配置项目的热修改

This commit is contained in:
远野千束 2024-03-29 15:12:14 +08:00
parent aed63c34c9
commit dd30b64004

12
main.py
View File

@ -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()