feat: 添加Discord适配器与跨平台消息互通功能
新增Discord适配器支持,实现Discord与QQ之间的消息互通 添加通用数据模型用于跨平台消息转换 扩展配置系统以支持Discord和日志配置 重构日志系统以使用配置中的日志级别 在反向WebSocket管理器中注册Bot实例 更新主程序以支持Discord客户端启动 添加测试脚本验证核心功能
This commit is contained in:
@@ -7,7 +7,7 @@ from pathlib import Path
|
||||
|
||||
import tomllib
|
||||
from pydantic import ValidationError
|
||||
from .config_models import ConfigModel, NapCatWSModel, BotModel, RedisModel, DockerModel, ImageManagerModel, MySQLModel, ReverseWSModel, ThreadingModel, BilibiliModel, LocalFileServerModel
|
||||
from .config_models import ConfigModel, NapCatWSModel, BotModel, RedisModel, DockerModel, ImageManagerModel, MySQLModel, ReverseWSModel, ThreadingModel, BilibiliModel, LocalFileServerModel, DiscordModel, LoggingModel
|
||||
from .utils.logger import ModuleLogger
|
||||
from .utils.exceptions import ConfigError, ConfigNotFoundError, ConfigValidationError
|
||||
|
||||
@@ -156,7 +156,20 @@ class Config:
|
||||
获取本地文件服务器配置
|
||||
"""
|
||||
return self._model.local_file_server
|
||||
|
||||
@property
|
||||
def discord(self) -> DiscordModel:
|
||||
"""
|
||||
获取 Discord 配置
|
||||
"""
|
||||
return self._model.discord
|
||||
|
||||
@property
|
||||
def logging(self) -> LoggingModel:
|
||||
"""
|
||||
获取日志配置
|
||||
"""
|
||||
return self._model.logging
|
||||
|
||||
|
||||
# 实例化全局配置对象
|
||||
|
||||
Reference in New Issue
Block a user