mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
Merge pull request #1414 from onerrogus/fix_link_preview
Corrigir utilização do linkPreview no WhatsApp Business API
This commit is contained in:
commit
c74eee8e52
@ -752,7 +752,6 @@ export class BusinessStartupService extends ChannelStartupService {
|
|||||||
try {
|
try {
|
||||||
let quoted: any;
|
let quoted: any;
|
||||||
let webhookUrl: any;
|
let webhookUrl: any;
|
||||||
const linkPreview = options?.linkPreview != false ? undefined : false;
|
|
||||||
if (options?.quoted) {
|
if (options?.quoted) {
|
||||||
const m = options?.quoted;
|
const m = options?.quoted;
|
||||||
|
|
||||||
@ -820,7 +819,7 @@ export class BusinessStartupService extends ChannelStartupService {
|
|||||||
to: number.replace(/\D/g, ''),
|
to: number.replace(/\D/g, ''),
|
||||||
text: {
|
text: {
|
||||||
body: message['conversation'],
|
body: message['conversation'],
|
||||||
preview_url: linkPreview,
|
preview_url: Boolean(options?.linkPreview),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
quoted ? (content.context = { message_id: quoted.id }) : content;
|
quoted ? (content.context = { message_id: quoted.id }) : content;
|
||||||
@ -837,7 +836,7 @@ export class BusinessStartupService extends ChannelStartupService {
|
|||||||
to: number.replace(/\D/g, ''),
|
to: number.replace(/\D/g, ''),
|
||||||
[message['mediaType']]: {
|
[message['mediaType']]: {
|
||||||
[message['type']]: message['id'],
|
[message['type']]: message['id'],
|
||||||
preview_url: linkPreview,
|
preview_url: Boolean(options?.linkPreview),
|
||||||
...(message['fileName'] && !isImage && !isVideo && { filename: message['fileName'] }),
|
...(message['fileName'] && !isImage && !isVideo && { filename: message['fileName'] }),
|
||||||
caption: message['caption'],
|
caption: message['caption'],
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user