diff --git a/pkg/core/entities.py b/pkg/core/entities.py index dbaa5ff..67b0566 100644 --- a/pkg/core/entities.py +++ b/pkg/core/entities.py @@ -110,7 +110,7 @@ class Session(pydantic.BaseModel): using_conversation: typing.Optional[Conversation] = None - conversations: typing.Optional[list[Conversation]] = [] + conversations: typing.Optional[list[Conversation]] = pydantic.Field(default_factory=list) create_time: typing.Optional[datetime.datetime] = pydantic.Field(default_factory=datetime.datetime.now) diff --git a/pkg/platform/manager.py b/pkg/platform/manager.py index d46e5b8..aed8def 100644 --- a/pkg/platform/manager.py +++ b/pkg/platform/manager.py @@ -2,6 +2,7 @@ from __future__ import annotations import json import os +import sys import logging import asyncio import traceback @@ -15,6 +16,10 @@ from .types import message as platform_message from .types import events as platform_events from .types import entities as platform_entities +# 处理 3.4 移除了 YiriMirai 之后,插件的兼容性问题 +from . import types as mirai +sys.modules['mirai'] = mirai + # 控制QQ消息输入输出的类 class PlatformManager: