"""装配入口:注册命令并运行 bot。""" import asyncio from aiohttp import ClientSession from loguru import logger from qqbotsdk import EventEmitter, run_loop from .config import BotConfig from .music import register async def amain() -> None: config = BotConfig.load() ee = EventEmitter() # 队列由 emitter 自建,run_loop 复用同一实例 # bot 自建连接池:直链探测不受 SDK 的 TIMEOUT 约束 async with ClientSession() as http: register(ee, config, http) await run_loop(ee) def main() -> None: try: asyncio.run(amain()) except KeyboardInterrupt: logger.info("musicbot 已退出")