This commit is contained in:
julien 2025-05-06 12:27:01 +02:00
parent e8e10a876e
commit c0c1d67cf4

View File

@ -73,8 +73,19 @@ app.post('/sendButtons', async (req, res) => {
if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' });
try {
const btnMsg = {
text: message,
buttons: buttons.map((b, i) => ({ buttonId: `btn_${i}`, buttonText: { displayText: b }, type: 1 })),
text: 'Choisis une option :',
buttons: [
{
buttonId: 'produits',
buttonText: { displayText: 'Voir produits' },
type: 1
},
{
buttonId: 'support',
buttonText: { displayText: 'Contacter support' },
type: 1
}
],
headerType: 1
};
console.log(btnMsg);