mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-09 01:49:37 -06:00
refactor(baileys): simplify linkPreview handling in BaileysStartupService
This commit is contained in:
parent
2feaf1c74e
commit
017949458b
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user