This commit is contained in:
julien 2025-05-06 14:02:30 +02:00
parent da74d76a7c
commit 5f74c970f3

View File

@ -134,95 +134,35 @@ app.post('/sendButtons', async (req, res) => {
deviceListMetadataVersion: 2 deviceListMetadataVersion: 2
}, },
interactiveMessage: proto.Message.InteractiveMessage.create({ interactiveMessage: proto.Message.InteractiveMessage.create({
body: { text: "Fizzxy Dev" }, body: { text: "Bienvenue sur notre service !" },
footer: { text: "Bot" }, footer: { text: "Choisis une action ci-dessous" },
header: { header: {
title: "Igna", title: "Menu principal",
subtitle: "test",
hasMediaAttachment: false hasMediaAttachment: false
}, },
nativeFlowMessage: { nativeFlowMessage: {
buttons: [ buttons: [
{
name: "single_select",
buttonParamsJson: JSON.stringify({
title: "title",
sections: [
{
title: "menu",
highlight_label: "label",
rows: [
{
header: "header",
title: "title",
description: "description",
id: "id1"
},
{
header: "header",
title: "title",
description: "description",
id: "id2"
}
]
}
]
})
},
{ {
name: "cta_reply", name: "cta_reply",
buttonParamsJson: JSON.stringify({ buttonParamsJson: JSON.stringify({
display_text: "quick_reply", display_text: "📩 Contacter support",
id: "message" id: "support_action"
}) })
}, },
{ {
name: "cta_url", name: "cta_url",
buttonParamsJson: JSON.stringify({ buttonParamsJson: JSON.stringify({
display_text: "Visiter Google", display_text: "🌐 Voir notre site",
url: "https://www.google.com", url: "https://canguidev.fr",
merchant_url: "https://www.google.com" merchant_url: "https://canguidev.fr"
}) })
}, },
{ {
name: "cta_call", name: "cta_call",
buttonParamsJson: JSON.stringify({ buttonParamsJson: JSON.stringify({
display_text: "Appeler support", display_text: "📞 Appeler le support",
id: "+33600000000" id: "+33612345678"
}) })
},
{
name: "cta_copy",
buttonParamsJson: JSON.stringify({
display_text: "Copier code",
id: "codecopie",
copy_code: "123456789"
})
},
{
name: "cta_reminder",
buttonParamsJson: JSON.stringify({
display_text: "Ajouter rappel",
id: "reminder_id"
})
},
{
name: "cta_cancel_reminder",
buttonParamsJson: JSON.stringify({
display_text: "Annuler rappel",
id: "reminder_id"
})
},
{
name: "address_message",
buttonParamsJson: JSON.stringify({
display_text: "Adresse",
id: "adresse_id"
})
},
{
name: "send_location",
buttonParamsJson: ""
} }
] ]
} }
@ -236,7 +176,7 @@ app.post('/sendButtons', async (req, res) => {
res.json({ success: true }); res.json({ success: true });
} catch (e) { } catch (e) {
console.error(e); console.error('❌ Erreur bouton actif :', e);
res.status(500).json({ error: e.message }); res.status(500).json({ error: e.message });
} }
}); });