Merge pull request #1414 from onerrogus/fix_link_preview

Corrigir utilização do linkPreview no WhatsApp Business API
This commit is contained in:
Davidson Gomes 2025-05-10 10:30:54 -03:00 committed by GitHub
commit c74eee8e52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -752,7 +752,6 @@ export class BusinessStartupService extends ChannelStartupService {
try {
let quoted: any;
let webhookUrl: any;
const linkPreview = options?.linkPreview != false ? undefined : false;
if (options?.quoted) {
const m = options?.quoted;
@ -820,7 +819,7 @@ export class BusinessStartupService extends ChannelStartupService {
to: number.replace(/\D/g, ''),
text: {
body: message['conversation'],
preview_url: linkPreview,
preview_url: Boolean(options?.linkPreview),
},
};
quoted ? (content.context = { message_id: quoted.id }) : content;
@ -837,7 +836,7 @@ export class BusinessStartupService extends ChannelStartupService {
to: number.replace(/\D/g, ''),
[message['mediaType']]: {
[message['type']]: message['id'],
preview_url: linkPreview,
preview_url: Boolean(options?.linkPreview),
...(message['fileName'] && !isImage && !isVideo && { filename: message['fileName'] }),
caption: message['caption'],
},