From 929d241fea51c5945734425a84e090a4dfb97163 Mon Sep 17 00:00:00 2001 From: Renato Miranda Date: Fri, 18 Jul 2025 14:12:38 -0300 Subject: [PATCH] fix send message to @lid --- src/whatsapp/services/whatsapp.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/whatsapp/services/whatsapp.service.ts b/src/whatsapp/services/whatsapp.service.ts index b5ff935f..83c628b7 100644 --- a/src/whatsapp/services/whatsapp.service.ts +++ b/src/whatsapp/services/whatsapp.service.ts @@ -54,6 +54,7 @@ import makeWASocket, { GroupMetadata, isJidGroup, isJidUser, + isLidUser, makeCacheableSignalKeyStore, MessageUpsertType, ParticipantAction, @@ -1259,7 +1260,7 @@ export class WAStartupService { throw new BadRequestException(isWA); } - const recipient = isJidGroup(jid) ? jid : isWA.jid; + const recipient = isLidUser(jid) ? jid : (isJidGroup(jid) ? jid : isWA.jid); if (isJidGroup(recipient)) { try { @@ -1965,6 +1966,8 @@ export class WAStartupService { onWhatsapp.push(new OnWhatsAppDto(group.id, !!group?.id, group?.subject)); } else if (jid.includes('@broadcast')) { onWhatsapp.push(new OnWhatsAppDto(jid, true)); + } else if (isLidUser(jid)) { + onWhatsapp.push(new OnWhatsAppDto(number, true)); } else { try { const result = (await this.client.onWhatsApp(jid))[0];