sfdesdfez
This commit is contained in:
parent
d687a2c127
commit
fd2062fb04
10
index.js
10
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',
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user