27 lines
776 B
Python
27 lines
776 B
Python
# -*- coding: utf-8 -*-
|
|
"""
|
|
跨平台消息互通插件入口
|
|
"""
|
|
import asyncio
|
|
from core.utils.logger import ModuleLogger
|
|
from .config import config
|
|
from .subscription import start_cross_platform_subscription, stop_cross_platform_subscription
|
|
from .handlers import *
|
|
|
|
# 创建模块专用日志记录器
|
|
logger = ModuleLogger("CrossPlatform")
|
|
|
|
# 插件加载时自动启动和加载配置
|
|
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()) |