diff --git a/index.js b/index.js index b4e04b8..0d9c0e3 100644 --- a/index.js +++ b/index.js @@ -60,6 +60,7 @@ app.post('/sendText', async (req, res) => { const { phone, message } = req.body; if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' }); try { + await sock.sendMessage(`${phone}@s.whatsapp.net`, { text: message }); res.json({ success: true }); } catch (e) { @@ -76,6 +77,7 @@ app.post('/sendButtons', async (req, res) => { buttons: buttons.map((b, i) => ({ buttonId: `btn_${i}`, buttonText: { displayText: b }, type: 1 })), headerType: 1 }; + console.log(btnMsg); await sock.sendMessage(`${phone}@s.whatsapp.net`, btnMsg); res.json({ success: true }); } catch (e) {