refactor(baileys): simplify linkPreview handling in BaileysStartupService

This commit is contained in:
Willian Coqueiro 2025-10-12 15:38:05 +00:00
parent 2feaf1c74e
commit 017949458b

View File

@ -2149,20 +2149,7 @@ export class BaileysStartupService extends ChannelStartupService {
}
}
let linkPreview: boolean | undefined;
let conversationText: string | undefined;
if (typeof message === 'object' && 'conversation' in message && typeof message['conversation'] === 'string') {
conversationText = message['conversation'];
if (conversationText.includes('[linkPreview=false]')) {
message['conversation'] = conversationText.replace('[linkPreview=false]', '').trim();
linkPreview = false;
}
}
if (linkPreview === undefined) {
linkPreview = options?.linkPreview != false ? undefined : false;
}
const linkPreview = options?.linkPreview != false ? undefined : false;
let quoted: WAMessage;