From 7eeadfa92deea7e61c277c7a75c1d0b49d7dca5c Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Sat, 6 Aug 2022 15:59:59 -0300 Subject: [PATCH] fix(whatsapp.gblib): SEND FILE sending bug. --- packages/whatsapp.gblib/services/WhatsappDirectLine.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index 8aad0edf..174fe34e 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -290,6 +290,16 @@ export class WhatsappDirectLine extends GBService { from = req.body.messages[0].author.split('@')[0]; fromName = req.body.messages[0].senderName; + if (message.type !== 'chat') { + attachments = []; + attachments.push( + { + name: 'uploaded', + contentType: 'application/octet-stream', + contentUrl: message.body + }); + } + if (req.body.messages[0].fromMe) { res.end();