Skip to content

Your lightweight open-source personal agent.

Merge branch 'main' into feature/qq-groupmessage

zhengliyuancedde6220151
diff --cc nanobot/channels/qq.py
index 8a7426104,0e8fe66ff..c0eb2b182
--- a/nanobot/channels/qq.py
+++ b/nanobot/channels/qq.py
@@@ -84,15 -72,18 +84,18 @@@ class QQChannel(BaseChannel)
self._client = BotClass()
self._bot_task = asyncio.create_task(self._run_bot())
- logger.info("QQ bot started (C2C private message)")
+ logger.info("QQ bot started (C2C & Group supported)")
async def _run_bot(self) -> None:
- """Run the bot connection."""
- try:
- await self._client.start(appid=self.config.app_id, secret=self.config.secret)
- except Exception as e:
- logger.error(f"QQ auth failed: {e}")
- self._running = False
+ """Run the bot connection with auto-reconnect."""
+ while self._running:
+ try:
+ await self._client.start(appid=self.config.app_id, secret=self.config.secret)
+ except Exception as e:
+ logger.warning(f"QQ bot error: {e}")
+ if self._running:
+ logger.info("Reconnecting QQ bot in 5 seconds...")
+ await asyncio.sleep(5)
async def stop(self) -> None:
"""Stop the QQ bot."""