refactor: implementar procesamiento de comandos directamente en handleMessageUpsert

Co-authored-by: aider (openrouter/x-ai/grok-code-fast-1) <aider@aider.chat>
pull/1/head
borja 2 months ago
parent 90fc363293
commit 8177a8eaa9

@ -209,15 +209,19 @@ export class WebhookServer {
mentionCount: mentions.length
});
const responses = await CommandService.handle({
sender: normalizedSenderId,
groupId: data.key.remoteJid,
message: messageText,
mentions
});
// Implement command processing logic here for real contact
let responseMessage = 'Comando procesado';
if (action === 'nueva') {
responseMessage = `Tarea creada: ${description}${dueDate ? ` (fecha límite: ${dueDate})` : ''}`;
} else {
responseMessage = `Acción ${action} no implementada aún`;
}
// Queue responses for sending
await ResponseQueue.add(responses);
// Queue response for sending
await ResponseQueue.add([{
recipient: normalizedSenderId,
message: responseMessage
}]);
}
}
@ -225,7 +229,7 @@ export class WebhookServer {
console.log(' Checking environment variables...');
console.log('EVOLUTION_API_URL:', process.env.EVOLUTION_API_URL ? '***' : 'MISSING');
console.log('EVOLUTION_API_INSTANCE:', process.env.EVOLUTION_API_INSTANCE || 'MISSING');
console.log('WEBHOOK_URL:', process.env.WEBHOOK_URL ? `${process.env.WEBHOOK_URL.substring(0, 20)}...` : 'MISSING');
console.log('WEBHOOK_URL:', process.env.WEBHOOK_URL ? `${process.env.WEBHOOK_URL.substring(0, 20)}...` : 'NOT SET');
console.log('WHATSAPP_COMMUNITY_ID:', process.env.WHATSAPP_COMMUNITY_ID ? '***' : 'NOT SET (se mostrarán comunidades disponibles)');
const missing = REQUIRED_ENV.filter(v => !process.env[v]);

Loading…
Cancel
Save