diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f41a29f..7a4c3193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * Fixed dify agent integration * Update Baileys Version * Fixed proxy config in manager +* Fixed send messages in groups ### Break Changes diff --git a/src/api/controllers/instance.controller.ts b/src/api/controllers/instance.controller.ts index 12345557..310bf002 100644 --- a/src/api/controllers/instance.controller.ts +++ b/src/api/controllers/instance.controller.ts @@ -331,6 +331,7 @@ export class InstanceController { instance.client?.end(new Error('restart')); return await this.connectToWhatsapp({ instanceName }); } else if (state == 'connecting') { + instance.client?.ws?.close(); instance.client?.end(new Error('restart')); return await this.connectToWhatsapp({ instanceName }); } diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 33f8b6c9..02076aa0 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -3203,7 +3203,7 @@ export class BaileysStartupService extends ChannelStartupService { private async getGroupMetadataCache(groupJid: string) { if (!isJidGroup(groupJid)) return null; - const cacheConf = this.configService.get('CACHE'); + const cacheConf = configService.get('CACHE'); if ((cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') || cacheConf?.LOCAL?.ENABLED) { if (await groupMetadataCache.has(groupJid)) {