fix buttons

This commit is contained in:
Leifer Mendez
2022-02-23 15:55:56 +01:00
parent e23540593a
commit 902431c533
2 changed files with 22 additions and 3 deletions

13
app.js
View File

@@ -97,9 +97,18 @@ const listenMessage = () => client.on('message', async msg => {
console.log({ step })
if (step) {
const response = await responseMessages(step)
const response = await responseMessages(step);
/**
* Si quieres enviar botones
*/
await sendMessage(client, from, response.replyMessage, response.trigger);
if(response.hasOwnProperty('actions')){
const { actions } = response;
await sendMessageButton(client, from, null, actions);
return
}
if (!response.delay && response.media) {
sendMedia(client, from, response.media);

View File

@@ -34,7 +34,17 @@
"escribe *cursos* o *info*"
],
"media":null,
"trigger":null
"trigger":null,
"actions":{
"title":"¿Que te interesa ver?",
"message":"Recuerda todo este contenido es gratis y estaria genial que me siguas!",
"footer":"Gracias",
"buttons":[
{"body":"😎 Cursos"},
{"body":"👉 Youtube"},
{"body":"😁 Telegram"}
]
}
},
"STEP_2":{
"replyMessage":[