2
0

🔊 Add even more debug logs 🤔

This commit is contained in:
Baptiste Arnaud
2024-04-17 10:52:27 +02:00
parent 62fde80f86
commit 40dfa8cc60

View File

@@ -88,17 +88,22 @@ const processWhatsAppReply = async ({
if (!phoneNumberId) return { message: 'No phone number id found' }
console.log('Received message:', receivedMessage)
console.log('sessionId', `wa-${phoneNumberId}-${receivedMessage.from}`)
const { message } = await resumeWhatsAppFlow({
receivedMessage,
sessionId: `wa-${phoneNumberId}-${receivedMessage.from}`,
phoneNumberId,
credentialsId,
workspaceId,
contact: {
name: contactName,
phoneNumber: contactPhoneNumber,
},
})
console.log('Message:', message)
return { message }
try {
const { message } = await resumeWhatsAppFlow({
receivedMessage,
sessionId: `wa-${phoneNumberId}-${receivedMessage.from}`,
phoneNumberId,
credentialsId,
workspaceId,
contact: {
name: contactName,
phoneNumber: contactPhoneNumber,
},
})
console.log('Message:', message)
return { message }
} catch (err) {
console.error('Error:', err)
return { message: 'Error processing message' }
}
}