From 6e296f9296e48d72b0368c79b34c82b3a95a8634 Mon Sep 17 00:00:00 2001 From: AI Bot Date: Mon, 24 Aug 2026 10:36:54 -0500 Subject: [PATCH] feat(webhook): lock processing to specific whatsapp group only --- src/app/api/webhooks/whatsapp/route.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/api/webhooks/whatsapp/route.ts b/src/app/api/webhooks/whatsapp/route.ts index ecf06c4..3a54631 100644 --- a/src/app/api/webhooks/whatsapp/route.ts +++ b/src/app/api/webhooks/whatsapp/route.ts @@ -48,10 +48,10 @@ export async function POST(req: Request) { return NextResponse.json({ success: true, message: 'Ignored bot self-message loop' }, { status: 200 }); } - // Recomendado: filtrar por el grupo especĂ­fico - // if (remoteJid !== TARGET_GROUP_JID) { - // return NextResponse.json({ success: true, message: 'Ignored other chat' }, { status: 200 }); - // } + // Filtrar estrictamente para que SOLO procese mensajes del grupo 'Publicaciones Almeira' + if (remoteJid !== TARGET_GROUP_JID) { + return NextResponse.json({ success: true, message: 'Ignored other chat' }, { status: 200 }); + } // Extraer texto del mensaje (ya guardado en rawText, lo mantenemos como text para retrocompatibilidad interna) const text = rawText;