diff --git a/CHANGELOG.md b/CHANGELOG.md index ff9c7b57..199f60d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Update contacts database with unique index * Save chat name * Correction of media as attachments in chatwoot when using a Meta API Instance and not Baileys +* Update Baileys version 6.7.6 # 2.0.9-rc (release candidate) diff --git a/package.json b/package.json index d3f3ca21..69522705 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@sentry/node": "^7.59.2", "amqplib": "^0.10.3", "axios": "^1.6.5", - "baileys": "github:WhiskeySockets/Baileys", + "baileys": "6.7.6", "class-validator": "^0.14.1", "compression": "^1.7.4", "cors": "^2.8.5", diff --git a/src/api/dto/chat.dto.ts b/src/api/dto/chat.dto.ts index fc2ff5d3..00da7fdd 100644 --- a/src/api/dto/chat.dto.ts +++ b/src/api/dto/chat.dto.ts @@ -1,4 +1,11 @@ -import { proto, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from 'baileys'; +import { + proto, + WAPresence, + WAPrivacyGroupAddValue, + WAPrivacyOnlineValue, + WAPrivacyValue, + WAReadReceiptsValue, +} from 'baileys'; export class OnWhatsAppDto { constructor( @@ -84,7 +91,7 @@ export class PrivacySettingDto { status: WAPrivacyValue; online: WAPrivacyOnlineValue; last: WAPrivacyValue; - groupadd: WAPrivacyValue; + groupadd: WAPrivacyGroupAddValue; } export class DeleteMessage { diff --git a/src/api/services/channels/whatsapp.baileys.service.ts b/src/api/services/channels/whatsapp.baileys.service.ts index b48368fb..f84cb6f7 100644 --- a/src/api/services/channels/whatsapp.baileys.service.ts +++ b/src/api/services/channels/whatsapp.baileys.service.ts @@ -35,7 +35,6 @@ import { Options, SendAudioDto, SendContactDto, - SendListDto, SendLocationDto, SendMediaDto, SendPollDto, @@ -1551,7 +1550,7 @@ export class BaileysStartupService extends ChannelStartupService { if (events['messaging-history.set']) { const payload = events['messaging-history.set']; - this.messageHandle['messaging-history.set'](payload); + this.messageHandle['messaging-history.set'](payload as any); } if (events['messages.upsert']) { @@ -2608,27 +2607,8 @@ export class BaileysStartupService extends ChannelStartupService { ); } - public async listMessage(data: SendListDto) { - return await this.sendMessageWithTyping( - data.number, - { - listMessage: { - title: data.title, - description: data?.description, - buttonText: data?.buttonText, - footerText: data?.footerText, - sections: data.sections, - listType: 2, - }, - }, - { - delay: data?.delay, - presence: 'composing', - quoted: data?.quoted, - mentionsEveryOne: data?.mentionsEveryOne, - mentioned: data?.mentioned, - }, - ); + public async listMessage() { + throw new BadRequestException('Method not available on WhatsApp Baileys'); } public async contactMessage(data: SendContactDto) {