From d3fce5fc89b648b3774ca9846bb137462138f23c Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Thu, 27 Jul 2023 08:45:02 -0300 Subject: [PATCH] fix: Fixed problem of getting message when deleting message in chatwoot --- CHANGELOG.md | 1 + src/whatsapp/services/chatwoot.service.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5013ceaf..97ea5c42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Fixed * Fixed error return bug +* Fixed problem of getting message when deleting message in chatwoot # 1.4.6 (2023-07-26 17:54) diff --git a/src/whatsapp/services/chatwoot.service.ts b/src/whatsapp/services/chatwoot.service.ts index 0f2f46c8..283a4198 100644 --- a/src/whatsapp/services/chatwoot.service.ts +++ b/src/whatsapp/services/chatwoot.service.ts @@ -930,6 +930,7 @@ export class ChatwootService { } public async receiveWebhook(instance: InstanceDto, body: any) { + console.log(body); try { this.logger.verbose('receive webhook to chatwoot instance: ' + instance.instanceName); const client = await this.clientCw(instance); @@ -940,7 +941,7 @@ export class ChatwootService { } this.logger.verbose('check if is bot'); - if (!body?.conversation || body.private) return { message: 'bot' }; + if (!body?.conversation || body.private || body.event === 'message_updated') return { message: 'bot' }; this.logger.verbose('check if is group'); const chatId =