mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 12:39:24 +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 })
|
console.log({ step })
|
||||||
|
|
||||||
if (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);
|
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) {
|
if (!response.delay && response.media) {
|
||||||
sendMedia(client, from, response.media);
|
sendMedia(client, from, response.media);
|
||||||
|
|||||||
@@ -34,7 +34,17 @@
|
|||||||
"escribe *cursos* o *info*"
|
"escribe *cursos* o *info*"
|
||||||
],
|
],
|
||||||
"media":null,
|
"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":{
|
"STEP_2":{
|
||||||
"replyMessage":[
|
"replyMessage":[
|
||||||
|
|||||||
Reference in New Issue
Block a user