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', },