feat(bot): 实现 BotManager 并完善机器人注销逻辑

添加全局 BotManager 单例用于统一管理所有 Bot 实例
在 WS 关闭和 ReverseWSManager 清理时调用注销逻辑
修改广播插件使用 BotManager 获取所有活跃 Bot 实例
移除 echo 插件的权限限制并更新文档配置
This commit is contained in:
2026-03-08 12:25:13 +08:00
parent 789d4e8ac7
commit dec1a43f28
8 changed files with 120 additions and 33 deletions

View File

@@ -255,6 +255,10 @@ class ReverseWSManager:
del self._client_health[client_id]
with self._bots_lock:
if client_id in self.bots:
# 从 BotManager 注销
from .bot_manager import bot_manager
if self.bots[client_id].self_id:
bot_manager.unregister_bot(str(self.bots[client_id].self_id))
del self.bots[client_id]
# 清理该客户端的防重复数据