myagent-ai 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chatbot/whatsapp_bot.py +3 -16
- package/package.json +1 -1
package/chatbot/whatsapp_bot.py
CHANGED
|
@@ -92,22 +92,9 @@ class WhatsAppBot(BaseChatBot):
|
|
|
92
92
|
# 检查是否已安装依赖
|
|
93
93
|
node_modules = bridge_dir / "node_modules"
|
|
94
94
|
if not node_modules.exists():
|
|
95
|
-
self.logger.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"npm", "install", "--production",
|
|
99
|
-
cwd=str(bridge_dir),
|
|
100
|
-
stdout=asyncio.subprocess.PIPE,
|
|
101
|
-
stderr=asyncio.subprocess.PIPE,
|
|
102
|
-
)
|
|
103
|
-
stdout, stderr = await asyncio.wait_for(proc.communicate(), timeout=120)
|
|
104
|
-
if proc.returncode != 0:
|
|
105
|
-
self.logger.error(f"Baileys 安装失败: {stderr.decode()[:500]}")
|
|
106
|
-
return
|
|
107
|
-
self.logger.info("Baileys 依赖安装完成")
|
|
108
|
-
except Exception as e:
|
|
109
|
-
self.logger.error(f"Baileys 安装异常: {e}")
|
|
110
|
-
return
|
|
95
|
+
self.logger.warning("Baileys 依赖未安装,请手动执行:")
|
|
96
|
+
self.logger.warning(f" cd {bridge_dir} && npm install")
|
|
97
|
+
return
|
|
111
98
|
|
|
112
99
|
env = os.environ.copy()
|
|
113
100
|
env["SESSION_DIR"] = self._session_dir
|