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é' });
|
if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' });
|
||||||
try {
|
try {
|
||||||
const btnMsg = {
|
const btnMsg = {
|
||||||
text: message,
|
text: 'Choisis une option :',
|
||||||
buttons: buttons.map((b, i) => ({ buttonId: `btn_${i}`, buttonText: { displayText: b }, type: 1 })),
|
buttons: [
|
||||||
|
{
|
||||||
|
buttonId: 'produits',
|
||||||
|
buttonText: { displayText: 'Voir produits' },
|
||||||
|
type: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
buttonId: 'support',
|
||||||
|
buttonText: { displayText: 'Contacter support' },
|
||||||
|
type: 1
|
||||||
|
}
|
||||||
|
],
|
||||||
headerType: 1
|
headerType: 1
|
||||||
};
|
};
|
||||||
console.log(btnMsg);
|
console.log(btnMsg);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user