chore: Deprecate buttons and list in new Baileys version

Updated CHANGELOG.md, package.json, src/api/dto/chat.dto.ts, and src/api/services/channels/whatsapp.baileys.service.ts to deprecate buttons and list due to the new Baileys version. This change improves compatibility and maintainability of the codebase.
This commit is contained in:
Davidson Gomes 2024-08-14 11:27:54 -03:00
parent 04f6e11cbd
commit 881a011493
4 changed files with 14 additions and 26 deletions

View File

@ -7,6 +7,7 @@
* Update contacts database with unique index * Update contacts database with unique index
* Save chat name * Save chat name
* Correction of media as attachments in chatwoot when using a Meta API Instance and not Baileys * 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) # 2.0.9-rc (release candidate)

View File

@ -55,7 +55,7 @@
"@sentry/node": "^7.59.2", "@sentry/node": "^7.59.2",
"amqplib": "^0.10.3", "amqplib": "^0.10.3",
"axios": "^1.6.5", "axios": "^1.6.5",
"baileys": "github:WhiskeySockets/Baileys", "baileys": "6.7.6",
"class-validator": "^0.14.1", "class-validator": "^0.14.1",
"compression": "^1.7.4", "compression": "^1.7.4",
"cors": "^2.8.5", "cors": "^2.8.5",

View File

@ -1,4 +1,11 @@
import { proto, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from 'baileys'; import {
proto,
WAPresence,
WAPrivacyGroupAddValue,
WAPrivacyOnlineValue,
WAPrivacyValue,
WAReadReceiptsValue,
} from 'baileys';
export class OnWhatsAppDto { export class OnWhatsAppDto {
constructor( constructor(
@ -84,7 +91,7 @@ export class PrivacySettingDto {
status: WAPrivacyValue; status: WAPrivacyValue;
online: WAPrivacyOnlineValue; online: WAPrivacyOnlineValue;
last: WAPrivacyValue; last: WAPrivacyValue;
groupadd: WAPrivacyValue; groupadd: WAPrivacyGroupAddValue;
} }
export class DeleteMessage { export class DeleteMessage {

View File

@ -35,7 +35,6 @@ import {
Options, Options,
SendAudioDto, SendAudioDto,
SendContactDto, SendContactDto,
SendListDto,
SendLocationDto, SendLocationDto,
SendMediaDto, SendMediaDto,
SendPollDto, SendPollDto,
@ -1551,7 +1550,7 @@ export class BaileysStartupService extends ChannelStartupService {
if (events['messaging-history.set']) { if (events['messaging-history.set']) {
const payload = 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']) { if (events['messages.upsert']) {
@ -2608,27 +2607,8 @@ export class BaileysStartupService extends ChannelStartupService {
); );
} }
public async listMessage(data: SendListDto) { public async listMessage() {
return await this.sendMessageWithTyping( throw new BadRequestException('Method not available on WhatsApp Baileys');
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 contactMessage(data: SendContactDto) { public async contactMessage(data: SendContactDto) {