From 2ff0b992e48426ca4c2d1ff417d99040afab4be5 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Sun, 28 Apr 2024 23:28:07 -0300 Subject: [PATCH] new(whatsapp.gblib): New WhatsApp provider: Meta. --- packages/whatsapp.gblib/services/WhatsappDirectLine.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index f609367dc..b5b9db4bc 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -826,7 +826,12 @@ export class WhatsappDirectLine extends GBService { case 'meta': if (req.body.entry[0].changes[0].value.statuses) { - GBLogEx.info(this.min, `WhatsApp:${id} ${senderName} ${req.body.entry[0].changes[0].value.statuses[0].status}.`); + if (req.body.entry[0].changes[0].value.statuses[0].status === 'failed'){ + id = req.body.entry[0].changes[0].value.messages[0].from; + senderName = req.body.entry[0].changes[0].value.contacts[0].profile.name; + + GBLogEx.error(this.min, `WhatsApp:${id} ${senderName} ${JSON.stringify(req.body.entry[0].changes[0])}.`); + } res.status(200); res.end();