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