mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-03-21 20:18:40 -06:00
feat: implement new Baileys features including PTV messages, poll decryption, and channel fetching
This commit is contained in:
@@ -2244,23 +2244,12 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
|
||||
const image = previewData.images && previewData.images.length > 0 ? previewData.images[0] : undefined;
|
||||
|
||||
let thumbnail: Buffer | undefined = undefined;
|
||||
if (image) {
|
||||
try {
|
||||
const response = await axios.get(image, { responseType: 'arraybuffer' });
|
||||
thumbnail = Buffer.from(response.data);
|
||||
} catch {
|
||||
// Ignore image fetch failures
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
externalAdReply: {
|
||||
title: previewData.title,
|
||||
body: previewData.description,
|
||||
mediaType: 1, // 1 for image, 2 for video. Using 1 for better cover image support with renderLargerThumbnail
|
||||
mediaType: 2, // 2 for video/image preview, though usually 1 is for thumbnail
|
||||
thumbnailUrl: image,
|
||||
thumbnail: thumbnail,
|
||||
sourceUrl: url,
|
||||
mediaUrl: url,
|
||||
renderLargerThumbnail: true
|
||||
|
||||
Reference in New Issue
Block a user