1
0
forked from bot/app

docs: 添加了部分内容

This commit is contained in:
2024-03-24 21:21:57 +08:00
parent bb27eea0c2
commit 788bca7113
8 changed files with 56 additions and 38 deletions

View File

@ -4,7 +4,7 @@ import nonebot
import yaml
from pydantic import BaseModel
config = {}
config = {} # 全局配置
class BasicConfig(BaseModel):
@ -16,8 +16,8 @@ class BasicConfig(BaseModel):
def load_from_yaml(file: str) -> dict:
nonebot.logger.debug("Loading config from %s" % file)
global config
nonebot.logger.debug("Loading config from %s" % file)
if not os.path.exists(file):
nonebot.logger.warning(f'Config file {file} not found, created default config, please modify it and restart')
with open(file, 'w', encoding='utf-8') as f: