diff --git a/index.js b/index.js index cd9fbcc..bcd872e 100644 --- a/index.js +++ b/index.js @@ -71,9 +71,8 @@ app.post('/sendText', async (req, res) => { app.post('/sendButtons', async (req, res) => { const { phone } = req.body; - if (!client || !isConnected) { - return res.status(400).json({ error: 'Non connecté' }); - } + if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' }); + const BASE_URL = process.env.BASE_URL || 'https://wa.canguidev.fr'; const imageUrl = `${BASE_URL}/static/logo-merlo-cs-FR.jpg`;