udp9
This commit is contained in:
parent
d8f5a02776
commit
20988733cf
36
index.js
36
index.js
@ -195,4 +195,40 @@ app.post('/sendButtons', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/sendInteractiveImage', async (req, res) => {
|
||||
const { phone } = req.body;
|
||||
if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' });
|
||||
|
||||
try {
|
||||
await sock.sendMessage(`${phone}@s.whatsapp.net`, {
|
||||
image: { url: 'https://fastly.picsum.photos/id/866/200/300.jpg' },
|
||||
caption: 'Description Of Messages',
|
||||
title: 'Title Of Messages',
|
||||
subtitle: 'Subtile Message',
|
||||
footer: 'Footer Messages',
|
||||
media: true,
|
||||
interactiveButtons: [
|
||||
{
|
||||
name: 'quick_reply',
|
||||
buttonParamsJson: JSON.stringify({
|
||||
display_text: 'Display Button',
|
||||
id: 'ID'
|
||||
})
|
||||
},
|
||||
{
|
||||
name: 'cta_url',
|
||||
buttonParamsJson: JSON.stringify({
|
||||
display_text: 'Display Button',
|
||||
url: 'https://www.google.com'
|
||||
})
|
||||
}
|
||||
]
|
||||
});
|
||||
res.json({ success: true });
|
||||
} catch (e) {
|
||||
console.error('❌ Erreur interactive image :', e);
|
||||
res.status(500).json({ error: e.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.listen(3001, () => console.log('🚀 Serveur Baileys démarré sur http://localhost:3001'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user