Skip to content

Commit 5097f13

Browse files
committed
fix: send message to group without no cache (local or redis)
1 parent 7353792 commit 5097f13

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,8 @@ export class BaileysStartupService extends ChannelStartupService {
13661366
ephemeralExpiration?: number,
13671367
// participants?: GroupParticipant[],
13681368
) {
1369+
sender = sender.toLowerCase();
1370+
13691371
const option: any = {
13701372
quoted,
13711373
};
@@ -1511,7 +1513,7 @@ export class BaileysStartupService extends ChannelStartupService {
15111513
throw new BadRequestException(isWA);
15121514
}
15131515

1514-
const sender = isWA.jid;
1516+
const sender = isWA.jid.toLowerCase();
15151517

15161518
this.logger.verbose(`Sending message to ${sender}`);
15171519

@@ -2743,10 +2745,10 @@ export class BaileysStartupService extends ChannelStartupService {
27432745
}
27442746
}
27452747

2746-
private async getGroupMetadataCache(groupJid: string) {
2748+
private getGroupMetadataCache = async (groupJid: string) => {
27472749
if (!isJidGroup(groupJid)) return null;
27482750

2749-
const cacheConf = configService.get<CacheConf>('CACHE');
2751+
const cacheConf = this.configService.get<CacheConf>('CACHE');
27502752

27512753
if ((cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') || cacheConf?.LOCAL?.ENABLED) {
27522754
if (await groupMetadataCache?.has(groupJid)) {
@@ -2765,7 +2767,7 @@ export class BaileysStartupService extends ChannelStartupService {
27652767
}
27662768

27672769
return await this.findGroup({ groupJid }, 'inner');
2768-
}
2770+
};
27692771

27702772
public async createGroup(create: CreateGroupDto) {
27712773
try {

0 commit comments

Comments
 (0)