mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-18 11:39:15 +00:00
fix buttons
This commit is contained in:
13
app.js
13
app.js
@@ -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);
|
||||
|
||||
@@ -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":[
|
||||
|
||||
Reference in New Issue
Block a user