From 076f2b492ea5e682eb23891ebfeb7f36aac55102 Mon Sep 17 00:00:00 2001 From: Gabriel Pastori <58153955+gabrielpastori1@users.noreply.github.com> Date: Mon, 18 Dec 2023 21:23:56 -0300 Subject: [PATCH 1/2] fix: chatwoot media process --- src/whatsapp/services/chatwoot.service.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/whatsapp/services/chatwoot.service.ts b/src/whatsapp/services/chatwoot.service.ts index cf32e00e..87f70219 100644 --- a/src/whatsapp/services/chatwoot.service.ts +++ b/src/whatsapp/services/chatwoot.service.ts @@ -1021,10 +1021,12 @@ export class ChatwootService { body.conversation.meta.sender?.phone_number?.replace('+', '') || body.conversation.meta.sender?.identifier; // Chatwoot to Whatsapp const messageReceived = body.content - .replaceAll(/(? Date: Tue, 19 Dec 2023 08:02:29 -0300 Subject: [PATCH 2/2] Add connected number and instance name to connected log --- src/whatsapp/services/whatsapp.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/whatsapp/services/whatsapp.service.ts b/src/whatsapp/services/whatsapp.service.ts index 4bbbe834..d8f7c997 100644 --- a/src/whatsapp/services/whatsapp.service.ts +++ b/src/whatsapp/services/whatsapp.service.ts @@ -1233,10 +1233,14 @@ export class WAStartupService { this.logger.verbose('Connection opened'); this.instance.wuid = this.client.user.id.replace(/:\d+/, ''); this.instance.profilePictureUrl = (await this.profilePicture(this.instance.wuid)).profilePictureUrl; + const formattedWuid = this.instance.wuid.split('@')[0].padEnd(30, ' '); + const formattedName = this.instance.name.split('@')[0].padEnd(30, ' '); this.logger.info( ` ┌──────────────────────────────┐ │ CONNECTED TO WHATSAPP │ + │${formattedWuid}│ + │${formattedName}│ └──────────────────────────────┘`.replace(/^ +/gm, ' '), );