From 0a4b8d202a1b4eed05b00256044c9816dc12f388 Mon Sep 17 00:00:00 2001 From: oismaelash Date: Fri, 4 Oct 2024 00:41:19 -0300 Subject: [PATCH 1/2] fix: transform any string on number to Lower Case, for not show reading id of undefined --- .../integrations/channel/whatsapp/whatsapp.baileys.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 99c7eb96..417d379e 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1676,6 +1676,8 @@ export class BaileysStartupService extends ChannelStartupService { ephemeralExpiration?: number, // participants?: GroupParticipant[], ) { + sender = sender.toLowerCase(); + const option: any = { quoted, }; From 2037e780456a4a924fbfbd10c8e2917f73428803 Mon Sep 17 00:00:00 2001 From: oismaelash Date: Fri, 4 Oct 2024 16:05:49 -0300 Subject: [PATCH 2/2] fix: send message to group without no cache (local or redis) --- .../channel/whatsapp/whatsapp.baileys.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index fb9c1d46..cf45c614 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -1840,7 +1840,7 @@ export class BaileysStartupService extends ChannelStartupService { throw new BadRequestException(isWA); } - const sender = isWA.jid; + const sender = isWA.jid.toLowerCase(); this.logger.verbose(`Sending message to ${sender}`); @@ -3290,10 +3290,10 @@ export class BaileysStartupService extends ChannelStartupService { } } - private async getGroupMetadataCache(groupJid: string) { + private getGroupMetadataCache = async (groupJid: string) => { if (!isJidGroup(groupJid)) return null; - const cacheConf = configService.get('CACHE'); + const cacheConf = this.configService.get('CACHE'); if ((cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') || cacheConf?.LOCAL?.ENABLED) { if (await groupMetadataCache?.has(groupJid)) {