收口855 provider运行时并同步适配路线图
This commit is contained in:
@@ -5,8 +5,10 @@ from wechat_ipad.providers.legacy_855.friends import FriendMixin
|
||||
from wechat_ipad.providers.legacy_855.group import ChatroomMixin
|
||||
from wechat_ipad.providers.legacy_855.login import LoginMixin
|
||||
from wechat_ipad.providers.legacy_855.message import MessageMixin
|
||||
from wechat_ipad.providers.legacy_855.runtime import Legacy855RuntimeMixin
|
||||
from wechat_ipad.providers.legacy_855.tools import ToolMixin
|
||||
from wechat_ipad.providers.legacy_855.user import UserMixin
|
||||
from wechat_ipad.providers.legacy_855.base import WechatAPIClientBase
|
||||
|
||||
|
||||
class Legacy855WechatClient(
|
||||
@@ -17,6 +19,7 @@ class Legacy855WechatClient(
|
||||
ChatroomMixin,
|
||||
UserMixin,
|
||||
ToolMixin,
|
||||
Legacy855RuntimeMixin,
|
||||
WechatProviderBase,
|
||||
):
|
||||
"""855/859 风格 server 的独立 Provider。
|
||||
@@ -30,6 +33,19 @@ class Legacy855WechatClient(
|
||||
provider_name = "legacy_855"
|
||||
server_type = "legacy_855"
|
||||
|
||||
def __init__(self, ip: str, port: int, **kwargs):
|
||||
"""初始化 855 provider。
|
||||
|
||||
说明:
|
||||
1. 旧 `wechat_ipad/client` 的多继承结构没有显式构造入口,迁移后这里补一个稳定初始化点;
|
||||
2. 基础连接信息仍写入 `WechatAPIClientBase`,消息发送队列继续沿用 `MessageMixin` 的实现;
|
||||
3. 运行时状态由 `Legacy855RuntimeMixin` 单独初始化,便于后续 864 provider 走自己的模型。
|
||||
"""
|
||||
del kwargs
|
||||
WechatAPIClientBase.__init__(self, ip, port)
|
||||
MessageMixin.__init__(self)
|
||||
self._init_runtime_state()
|
||||
|
||||
async def send_at_message(self, wxid: str, content: str, at: list[str]) -> tuple[int, int, int]:
|
||||
"""发送 @ 消息,兼容现有插件调用方式。"""
|
||||
if not self.wxid:
|
||||
@@ -47,4 +63,3 @@ class Legacy855WechatClient(
|
||||
output = content
|
||||
|
||||
return await self.send_text_message(wxid, output, at)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user