{"record":{"id":"9a39916c112b5ec5","repo":"HKUDS/nanobot","slug":"discord-client-is-not-ready","errorCode":null,"errorMessage":"Discord client is not ready","messagePattern":"Discord client is not ready","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/discord/runtime.py","lineNumber":471,"sourceCode":"            await self._client.start(self.config.token)\n        except asyncio.CancelledError:\n            raise\n        except Exception:\n            self.logger.exception(\"client startup failed\")\n        finally:\n            self._running = False\n            await self._reset_runtime_state(close_client=True)\n\n    async def stop(self) -> None:\n        \"\"\"Stop the Discord channel.\"\"\"\n        self._running = False\n        await self._reset_runtime_state(close_client=True)\n\n    async def send(self, msg: OutboundMessage) -> None:\n        \"\"\"Send a message through Discord using discord.py.\"\"\"\n        client = self._client\n        if client is None or not client.is_ready():\n            raise RuntimeError(\"Discord client is not ready\")\n\n        is_progress = isinstance(msg.event, ProgressEvent)\n\n        try:\n            await client.send_outbound(msg)\n        except Exception:\n            self.logger.exception(\"Error sending message\")\n            raise\n        finally:\n            if not is_progress:\n                await self._stop_typing(msg.chat_id)\n                await self._clear_reactions(msg.chat_id)\n\n    async def send_delta(\n        self,\n        chat_id: str,\n        delta: str,\n        metadata: dict[str, Any] | None = None,","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/discord/runtime.py#L453-L489","documentation":"Error \"Discord client is not ready\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/discord/runtime.py:471 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}