diff --git a/src/api/integrations/channel/evolution/evolution.channel.service.ts b/src/api/integrations/channel/evolution/evolution.channel.service.ts index 87bea08e6..3c09d6994 100644 --- a/src/api/integrations/channel/evolution/evolution.channel.service.ts +++ b/src/api/integrations/channel/evolution/evolution.channel.service.ts @@ -597,7 +597,11 @@ export class EvolutionStartupService extends ChannelStartupService { } public async mediaMessage(data: SendMediaDto, file?: any, isIntegration = false) { - const mediaData: SendMediaDto = { ...data }; + const mediaData: SendMediaDto = { + ...data, + // Normalize filename to fileName (handle case-insensitivity) + fileName: data.fileName || (data as any).filename, + }; if (file) mediaData.media = file.buffer.toString('base64'); diff --git a/src/api/integrations/channel/meta/whatsapp.business.service.ts b/src/api/integrations/channel/meta/whatsapp.business.service.ts index 1e4808c15..3acd2b361 100644 --- a/src/api/integrations/channel/meta/whatsapp.business.service.ts +++ b/src/api/integrations/channel/meta/whatsapp.business.service.ts @@ -1287,7 +1287,11 @@ export class BusinessStartupService extends ChannelStartupService { } public async mediaMessage(data: SendMediaDto, file?: any, isIntegration = false) { - const mediaData: SendMediaDto = { ...data }; + const mediaData: SendMediaDto = { + ...data, + // Normalize filename to fileName (handle case-insensitivity) + fileName: data.fileName || (data as any).filename, + }; if (file) mediaData.media = file.buffer.toString('base64'); diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index 60e857fcc..308bcc492 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -2372,7 +2372,7 @@ export class BaileysStartupService extends ChannelStartupService { throw new NotFoundException('Group not found'); } - if (options?.mentionsEveryOne) { + if (options?.mentionsEveryOne === true) { mentions = group.participants.map((participant) => participant.id); } else if (options?.mentioned?.length) { mentions = options.mentioned.map((mention) => { @@ -2979,7 +2979,11 @@ export class BaileysStartupService extends ChannelStartupService { } public async mediaMessage(data: SendMediaDto, file?: any, isIntegration = false) { - const mediaData: SendMediaDto = { ...data }; + const mediaData: SendMediaDto = { + ...data, + // Normalize filename to fileName (handle case-insensitivity) + fileName: data.fileName || (data as any).filename, + }; if (file) mediaData.media = file.buffer.toString('base64'); diff --git a/src/validate/message.schema.ts b/src/validate/message.schema.ts index d514c6199..d4771331e 100644 --- a/src/validate/message.schema.ts +++ b/src/validate/message.schema.ts @@ -77,7 +77,7 @@ export const textMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1, @@ -107,7 +107,7 @@ export const mediaMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1, @@ -133,7 +133,7 @@ export const ptvMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1, @@ -159,7 +159,7 @@ export const audioMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1, @@ -209,7 +209,7 @@ export const stickerMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1, @@ -238,7 +238,7 @@ export const locationMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1, @@ -325,7 +325,7 @@ export const pollMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1, @@ -382,7 +382,7 @@ export const listMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1, @@ -433,7 +433,7 @@ export const buttonsMessageSchema: JSONSchema7 = { description: 'Enter a value in milliseconds', }, quoted: { ...quotedOptionsSchema }, - everyOne: { type: 'boolean', enum: [true, false] }, + mentionsEveryOne: { type: 'boolean', enum: [true, false] }, mentioned: { type: 'array', minItems: 1,