Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix(qq): remove dead _bot_task field and fix stop() to close client
Re-binb53c3d39edec
diff --git a/nanobot/channels/qq.py b/nanobot/channels/qq.pyindex a940a7557..5352a3096 100644--- a/nanobot/channels/qq.py+++ b/nanobot/channels/qq.py@@ -55,7 +55,6 @@ class QQChannel(BaseChannel):self.config: QQConfig = configself._client: "botpy.Client | None" = Noneself._processed_ids: deque = deque(maxlen=1000)- self._bot_task: asyncio.Task | None = Noneasync def start(self) -> None:"""Start the QQ bot."""@@ -88,11 +87,10 @@ class QQChannel(BaseChannel):async def stop(self) -> None:"""Stop the QQ bot."""self._running = False- if self._bot_task:- self._bot_task.cancel()+ if self._client:try:- await self._bot_task- except asyncio.CancelledError:+ await self._client.close()+ except Exception:passlogger.info("QQ bot stopped")@@ -130,5 +128,5 @@ class QQChannel(BaseChannel):content=content,metadata={"message_id": data.id},)- except Exception as e:- logger.error("Error handling QQ message: {}", e)+ except Exception:+ logger.exception("Error handling QQ message")