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];