From 047753075792c944487043ed22307e9f8aa04324 Mon Sep 17 00:00:00 2001 From: "borja (aider)" Date: Fri, 2 May 2025 16:49:55 +0200 Subject: [PATCH] fix: properly extract dates and count mentions in /tarea command --- src/server.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/server.ts b/src/server.ts index 093a6b2..6323303 100644 --- a/src/server.ts +++ b/src/server.ts @@ -137,15 +137,14 @@ export class WebhookServer { if (date >= today) { dueDate = part; - } else { - descriptionParts.push(part); // Keep past dates in description + continue; // Skip adding to description } - } else { - descriptionParts.push(part); + // Fall through to add invalid/past dates to description } + descriptionParts.push(part); } - const description = descriptionParts.join(' '); + const description = descriptionParts.join(' ').trim(); console.log('🔍 Detected /tarea command:', { timestamp: new Date().toISOString(), @@ -154,7 +153,7 @@ export class WebhookServer { rawMessage: messageText }); - const mentions = data.contextInfo?.mentionedJid || []; + const mentions = data.message?.contextInfo?.mentionedJid || []; console.log('✅ Successfully parsed command:', { action, description,