PEPEPPEPEPE
This commit is contained in:
parent
a1b111abea
commit
60f0425f38
41
index.js
41
index.js
@ -607,6 +607,47 @@ app.post('/testButtons2', async (req, res) => {
|
|||||||
res.status(500).json({ error: e.message });
|
res.status(500).json({ error: e.message });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
app.post('/testButtons3', async (req, res) => {
|
||||||
|
const { phone } = req.body;
|
||||||
|
|
||||||
|
if (!sock || !isConnected) {
|
||||||
|
return res.status(400).json({ error: 'Non connecté' });
|
||||||
|
}
|
||||||
|
|
||||||
|
const jid = `${phone}@s.whatsapp.net`;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await sock.sendMessage(jid, {
|
||||||
|
text: 'Hello World!',
|
||||||
|
footer: '© Fizzxy Dev',
|
||||||
|
templateButtons: [
|
||||||
|
{
|
||||||
|
index: 0,
|
||||||
|
urlButton: {
|
||||||
|
displayText: 'Visiter Site',
|
||||||
|
url: 'https://google.fr'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
index: 1,
|
||||||
|
urlButton: {
|
||||||
|
displayText: 'Voir logo',
|
||||||
|
url: 'https://google.fr'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
quoted: null
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
res.json({ success: true });
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
console.error('❌ Erreur testButtons :', e);
|
||||||
|
res.status(500).json({ error: e.message });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// 5) 404 et gestion des erreurs
|
// 5) 404 et gestion des erreurs
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user