初始化所有平台适配器
(self)
| 85 | await self._stop_platform_task(client_id) |
| 86 | |
| 87 | async def initialize(self) -> None: |
| 88 | """初始化所有平台适配器""" |
| 89 | for platform in self.platforms_config: |
| 90 | try: |
| 91 | if ensure_platform_webhook_config(platform): |
| 92 | self.astrbot_config.save_config() |
| 93 | await self.load_platform(platform) |
| 94 | except Exception as e: |
| 95 | logger.error(f"初始化 {platform} 平台适配器失败: {e}") |
| 96 | |
| 97 | # 网页聊天 |
| 98 | webchat_inst = WebChatAdapter({}, self.settings, self.event_queue) |
| 99 | self.platform_insts.append(webchat_inst) |
| 100 | self._start_platform_task("webchat", webchat_inst) |
| 101 | |
| 102 | async def load_platform(self, platform_config: dict) -> None: |
| 103 | """实例化一个平台""" |
nothing calls this directly
no test coverage detected