refactor(managers): 重构单例管理器实现并优化代码结构
feat(ws_pool): 新增 WebSocket 连接池实现 perf(json): 使用 orjson 替代标准 json 库提升性能 style: 清理未使用的导入和冗余代码 docs: 更新架构文档和开发规范 test: 添加 WebSocket 连接池测试用例 fix(plugins): 修复自动审批插件 API 调用参数格式
This commit is contained in:
@@ -68,12 +68,15 @@ class MessageEvent(OneBotEvent):
|
||||
sender: Optional[Sender] = None
|
||||
"""发送者信息"""
|
||||
|
||||
# 权限级别常量,用于装饰器参数
|
||||
ADMIN = Permission.ADMIN
|
||||
OP = Permission.OP
|
||||
USER = Permission.USER
|
||||
|
||||
@property
|
||||
def post_type(self) -> str:
|
||||
return EventType.MESSAGE
|
||||
|
||||
|
||||
|
||||
async def reply(self, message: Union[str, "MessageSegment", List["MessageSegment"]], auto_escape: bool = False):
|
||||
"""
|
||||
回复消息(抽象方法,由子类实现)
|
||||
@@ -84,12 +87,6 @@ class MessageEvent(OneBotEvent):
|
||||
raise NotImplementedError("reply method must be implemented by subclasses")
|
||||
|
||||
|
||||
# 在类定义之后添加权限常量作为类变量
|
||||
MessageEvent.ADMIN = MESSAGE_EVENT_ADMIN
|
||||
MessageEvent.OP = MESSAGE_EVENT_OP
|
||||
MessageEvent.USER = MESSAGE_EVENT_USER
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class PrivateMessageEvent(MessageEvent):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user