@peopl-health/nexus 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/NexusMessaging.js +4 -15
- package/package.json +1 -1
|
@@ -332,27 +332,16 @@ class NexusMessaging {
|
|
|
332
332
|
|
|
333
333
|
async handleMessageWithAssistant(messageData) {
|
|
334
334
|
try {
|
|
335
|
-
|
|
336
|
-
const internalMessage = this.provider.constructor.name === 'TwilioProvider'
|
|
337
|
-
? convertTwilioToInternalFormat(messageData)
|
|
338
|
-
: messageData;
|
|
339
|
-
|
|
340
|
-
// Extract standardized data
|
|
341
|
-
const extractedData = {
|
|
342
|
-
from: internalMessage.key?.remoteJid || '',
|
|
343
|
-
message: internalMessage.message?.conversation || '',
|
|
344
|
-
messageId: internalMessage.key?.id || '',
|
|
345
|
-
fromMe: internalMessage.key?.fromMe || false
|
|
346
|
-
};
|
|
335
|
+
console.log('MESSAGE DATA', messageData);
|
|
347
336
|
|
|
348
337
|
const response = await replyAssistant(
|
|
349
|
-
|
|
350
|
-
|
|
338
|
+
messageData.from,
|
|
339
|
+
messageData.message
|
|
351
340
|
);
|
|
352
341
|
|
|
353
342
|
if (response) {
|
|
354
343
|
await this.sendMessage({
|
|
355
|
-
to:
|
|
344
|
+
to: messageData.from,
|
|
356
345
|
message: response
|
|
357
346
|
});
|
|
358
347
|
}
|