Skip to content

Commit fcc26f9

Browse files
Merge pull request #947 from oismaelash/v2.0.0
fix: send message to group without no cache (local or redis)
2 parents 161abf1 + 2037e78 commit fcc26f9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,6 +1677,8 @@ export class BaileysStartupService extends ChannelStartupService {
16771677
ephemeralExpiration?: number,
16781678
// participants?: GroupParticipant[],
16791679
) {
1680+
sender = sender.toLowerCase();
1681+
16801682
const option: any = {
16811683
quoted,
16821684
};
@@ -1838,7 +1840,7 @@ export class BaileysStartupService extends ChannelStartupService {
18381840
throw new BadRequestException(isWA);
18391841
}
18401842

1841-
const sender = isWA.jid;
1843+
const sender = isWA.jid.toLowerCase();
18421844

18431845
this.logger.verbose(`Sending message to ${sender}`);
18441846

@@ -3308,10 +3310,10 @@ export class BaileysStartupService extends ChannelStartupService {
33083310
}
33093311
}
33103312

3311-
private async getGroupMetadataCache(groupJid: string) {
3313+
private getGroupMetadataCache = async (groupJid: string) => {
33123314
if (!isJidGroup(groupJid)) return null;
33133315

3314-
const cacheConf = configService.get<CacheConf>('CACHE');
3316+
const cacheConf = this.configService.get<CacheConf>('CACHE');
33153317

33163318
if ((cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') || cacheConf?.LOCAL?.ENABLED) {
33173319
if (await groupMetadataCache?.has(groupJid)) {

0 commit comments

Comments
 (0)