1
0
forked from bot/app

📝 初次启动生成默认配置文件时添加 satori 相关配置

📝 将适配器配置初始化和注册移动到 utils.adapter_manager
This commit is contained in:
Expliyh
2024-05-17 17:51:42 +08:00
parent c914ddc0ee
commit 974b97b744
6 changed files with 84 additions and 10 deletions

View File

@ -1,4 +1,5 @@
import os
from typing import List
import nonebot
import yaml
@ -11,12 +12,26 @@ from ..message.tools import random_hex_string
config = {} # 全局配置,确保加载后读取
class SatoriNodeConfig(BaseModel):
host: str = ""
port: str = "5500"
path: str = ""
token: str = ""
class SatoriConfig(BaseModel):
comment: str = "These features are still in development. Do not enable in production environment."
enable: bool = False
hosts: List[SatoriNodeConfig] = [SatoriNodeConfig()]
class BasicConfig(BaseModel):
host: str = "127.0.0.1"
port: int = 20216
superusers: list[str] = []
command_start: list[str] = ["/", ""]
nickname: list[str] = [f"LiteyukiBot-{random_hex_string(6)}"]
satori: SatoriConfig = SatoriConfig()
def load_from_yaml(file: str) -> dict: