This commit is contained in:
julien 2025-05-06 13:52:08 +02:00
parent 799102c9f1
commit 2b07bfd426

View File

@ -122,15 +122,21 @@ app.post('/sendText', async (req, res) => {
}); });
app.post('/sendButtons', async (req, res) => { app.post('/sendButtons', async (req, res) => {
const { phone } = req.body; sock.sendMessage(jid, {
if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' }); text: "Hello World !",
try { footer: "Fizzxy - 2025",
await sendInteractive(sock, `${phone}@s.whatsapp.net`, 'https://placekitten.com/300/200'); buttons: [
res.json({ success: true }); {
} catch (e) { buttonId: `🚀`,
console.error(e); buttonText: {
res.status(500).json({ error: e.message }); displayText: '🗿'
},
type: 1
} }
],
headerType: 1,
viewOnce: true
},{ quoted: null })
}); });
app.listen(3001, () => console.log('🚀 Serveur Baileys démarré sur http://localhost:3001')); app.listen(3001, () => console.log('🚀 Serveur Baileys démarré sur http://localhost:3001'));