Actualizar server.js
This commit is contained in:
@@ -3989,7 +3989,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)
|
||||||
|
|||||||
Reference in New Issue
Block a user