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