From fd2062fb043e78f4a1193fff1df80e002fc2ccba Mon Sep 17 00:00:00 2001 From: julien Date: Tue, 6 May 2025 16:13:06 +0200 Subject: [PATCH] sfdesdfez --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 383546d..aea965b 100644 --- a/index.js +++ b/index.js @@ -128,13 +128,19 @@ app.post('/sendInteractiveImage', async (req, res) => { const imagePath = path.join(__dirname, 'public', 'logo-merlo-cs-FR.jpg'); const imageBuffer = fs.readFileSync(imagePath); - // Configuration du message interactif + // Préparation du média avec upload sécurisé + const uploadedMedia = await sock.uploadMedia(imageBuffer, { + mimetype: 'image/jpeg', + filename: 'merlo-image.jpg' + }); + + // Construction du message interactif const message = { interactive: { type: 'button', header: { type: 'IMAGE', - image: imageBuffer, + image: { url: uploadedMedia }, title: title || 'Titre par défaut', subtitle: subtitle || 'Sous-titre', },