test
This commit is contained in:
parent
e8e10a876e
commit
c0c1d67cf4
15
index.js
15
index.js
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user