upd6
This commit is contained in:
parent
5f74c970f3
commit
f4da3e1d51
76
index.js
76
index.js
@ -127,50 +127,44 @@ app.post('/sendButtons', async (req, res) => {
|
||||
|
||||
try {
|
||||
const content = {
|
||||
viewOnceMessage: {
|
||||
message: {
|
||||
messageContextInfo: {
|
||||
deviceListMetadata: {},
|
||||
deviceListMetadataVersion: 2
|
||||
message: {
|
||||
interactiveMessage: proto.Message.InteractiveMessage.create({
|
||||
body: { text: "Bienvenue sur notre service !" },
|
||||
footer: { text: "Choisis une action ci-dessous" },
|
||||
header: {
|
||||
title: "Menu principal",
|
||||
hasMediaAttachment: false
|
||||
},
|
||||
interactiveMessage: proto.Message.InteractiveMessage.create({
|
||||
body: { text: "Bienvenue sur notre service !" },
|
||||
footer: { text: "Choisis une action ci-dessous" },
|
||||
header: {
|
||||
title: "Menu principal",
|
||||
hasMediaAttachment: false
|
||||
},
|
||||
nativeFlowMessage: {
|
||||
buttons: [
|
||||
{
|
||||
name: "cta_reply",
|
||||
buttonParamsJson: JSON.stringify({
|
||||
display_text: "📩 Contacter support",
|
||||
id: "support_action"
|
||||
})
|
||||
},
|
||||
{
|
||||
name: "cta_url",
|
||||
buttonParamsJson: JSON.stringify({
|
||||
display_text: "🌐 Voir notre site",
|
||||
url: "https://canguidev.fr",
|
||||
merchant_url: "https://canguidev.fr"
|
||||
})
|
||||
},
|
||||
{
|
||||
name: "cta_call",
|
||||
buttonParamsJson: JSON.stringify({
|
||||
display_text: "📞 Appeler le support",
|
||||
id: "+33612345678"
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
nativeFlowMessage: {
|
||||
buttons: [
|
||||
{
|
||||
name: "cta_reply",
|
||||
buttonParamsJson: JSON.stringify({
|
||||
display_text: "📩 Contacter support",
|
||||
id: "support_action"
|
||||
})
|
||||
},
|
||||
{
|
||||
name: "cta_url",
|
||||
buttonParamsJson: JSON.stringify({
|
||||
display_text: "🌐 Voir notre site",
|
||||
url: "https://canguidev.fr",
|
||||
merchant_url: "https://canguidev.fr"
|
||||
})
|
||||
},
|
||||
{
|
||||
name: "cta_call",
|
||||
buttonParamsJson: JSON.stringify({
|
||||
display_text: "📞 Appeler le support",
|
||||
id: "+33612345678"
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const msg = generateWAMessageFromContent(`${phone}@s.whatsapp.net`, content, {});
|
||||
await sock.relayMessage(`${phone}@s.whatsapp.net`, msg.message, { messageId: msg.key.id });
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user