diff --git a/robot.py b/robot.py index eeac484..a27f744 100644 --- a/robot.py +++ b/robot.py @@ -230,7 +230,7 @@ class Robot: self.LOG.info("开始处理wechat_ipad消息") while self.ipad_running: try: - data = await self.ipad_bot.sync_message() + data_temp = await self.ipad_bot.sync_message() except Exception as e: self.LOG.error(f"获取新消息失败 {e}") if "用户可能退出" in str(e): @@ -242,7 +242,7 @@ class Robot: await asyncio.sleep(5) continue - data = data.get("AddMsgs") + data = data_temp.get("AddMsgs") if data: for message in data: # self.LOG.debug(f"sync_message.处理消息消息内容: {message}") @@ -262,7 +262,7 @@ class Robot: # 并发执行,限制最大并发数 xx = asyncio.create_task(self._process_with_semaphore(wxmsg)) else: - self.LOG.debug(f"MESSAGE:{data}") + self.LOG.debug(f"MESSAGE:{data_temp}") # 使用异步睡眠替代忙等待循环 await asyncio.sleep(2)