2024-09-28 09:24:29 +08:00

26 lines
1009 B
Python

from pydantic import BaseModel
from typing import Optional, List
from nonebot import get_driver, get_plugin_config
class ScopedConfig(BaseModel):
get_num: int = 5 # 获取人数数量
font: str = "SimHei" # 字体格式
suffix: bool = True # 是否显示后缀
excluded_self: bool = True # 是否排除自己
visualization: bool = True # 是否可视化
counting_cache: bool = False # 计数缓存(能够提高回复速度)
excluded_people: List[str] = [] # 排除的人的QQ号
timezone: Optional[str] = "Asia/Shanghai" # 时区,影响统计时间
string_suffix: str = "统计花费时间:{timecost}" # 消息格式后缀
template_path: str = "./template/rank_template.j2" # 模板路径
string_format: str = "{index}名:\n{nickname},{chatdatanum}条消息\n" # 消息格式
class Config(BaseModel):
dialectlist: ScopedConfig = ScopedConfig()
global_config = get_driver().config
plugin_config = get_plugin_config(Config).dialectlist