feat: 新增跨平台消息互通插件及适配器优化
refactor(discord_adapter): 优化音频处理与心跳机制 feat(plugins/discord-cross): 实现QQ与Discord消息互通功能 fix(events/base): 添加platform字段到基础事件模型
This commit is contained in:
24
plugins/discord-cross/__init__.py
Normal file
24
plugins/discord-cross/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
跨平台消息互通插件入口
|
||||
"""
|
||||
import asyncio
|
||||
from core.utils.logger import logger
|
||||
from .config import config
|
||||
from .subscription import start_cross_platform_subscription, stop_cross_platform_subscription
|
||||
from .handlers import *
|
||||
|
||||
# 插件加载时自动启动和加载配置
|
||||
try:
|
||||
asyncio.create_task(config.reload())
|
||||
except Exception as e:
|
||||
logger.error(f"[CrossPlatform] 重新加载配置失败: {e}")
|
||||
|
||||
try:
|
||||
asyncio.create_task(start_cross_platform_subscription())
|
||||
except Exception as e:
|
||||
logger.error(f"[CrossPlatform] 启动订阅失败: {e}")
|
||||
|
||||
def cleanup():
|
||||
"""清理资源"""
|
||||
asyncio.create_task(stop_cross_platform_subscription())
|
||||
Reference in New Issue
Block a user