Actualizar server.js

This commit is contained in:
2026-03-23 20:31:53 +00:00
parent 56a1e4606d
commit 7b693fc333

View File

@@ -3986,7 +3986,7 @@ app.post("/webhook/evolution", async (req, res) => {
const lastMsg = checkHumanQ.rows[0]; const lastMsg = checkHumanQ.rows[0];
const diffMinutos = (new Date() - new Date(lastMsg.created_at)) / (1000 * 60); const diffMinutos = (new Date() - new Date(lastMsg.created_at)) / (1000 * 60);
// Como tu mensaje se guardó como 'operario', aquí saltará esta regla y detendrá a la IA durante 120 min // Como tu mensaje se guardó como 'operario', aquí saltará esta regla y detendrá a la IA durante 120 min
if (['admin', 'superadmin', 'operario'].includes(lastMsg.sender_role) && diffMinutos < 120) return; if (['admin', 'superadmin', 'operario'].includes(lastMsg.sender_role) && diffMinutos < 0) return;
} }
// 🧠 LLAMADA A LA IA (Con la hora inyectada) // 🧠 LLAMADA A LA IA (Con la hora inyectada)