Command exited with code 0. Command output: 500- api_hash=self.api_hash, 501- bot_token=self.bot_token, 502- in_memory=True, 503- sleep_threshold=10, 504- ) 505: self.bot.add_handler(MessageHandler(self._handle_bot_message)) 506- await self.bot.start() 507- log("[bot recovery] Bot client restarted and listening successfully!") 508- except Exception as exc: 509- log(f"[bot recovery] Failed to restart bot client: {exc}") 510- finally: -- 629- self.http = aiohttp.ClientSession(connector=connector) 630- self._migrate_legacy_workspace_if_needed() 631- self._migrate_fcm_urls() 632- self._sync_old_fcm_creds() 633- 634: self.bot.add_handler(MessageHandler(self._handle_bot_message)) 635- try: 636- await self.bot.start() 637- except FloodWait as exc: 638- log(f"[FLOOD WAIT] Telegram bot auth rate limited. Required wait: {exc.value}s (~{round(exc.value/60, 1)}m). Sleeping to avoid PM2 crash loop...") 639- await asyncio.sleep(exc.value + 5) -- 655- auth_status = await self.main_client.get_me() 656- if auth_status: 657- await self.main_client.disconnect() 658- await self.main_client.start() 659- self.main_client_ready = True 660: self.main_client.add_handler(MessageHandler(self._on_main_message)) 661- async for _ in self.main_client.get_dialogs(): 662- pass 663- else: 664- await self.main_client.disconnect() 665- log("Main session is not authorized. Please login via bot.") -- 1614- pass 1615- self.main_client = self._build_main_client() 1616- try: 1617- await self.main_client.start() 1618- self.main_client_ready = True 1619: self.main_client.add_handler(MessageHandler(self._on_main_message)) 1620- async for _ in self.main_client.get_dialogs(): 1621- pass 1622- log("Main client dynamically started after login via bot.") 1623- except Exception as e: 1624- log(f"Failed to start main client after login: {e}")