mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 04:29:16 +00:00
improve
This commit is contained in:
@@ -36,14 +36,10 @@ const sendMessage = async (client, number = null, text = null, trigger = null) =
|
||||
* Enviamos un mensaje con buttons a nuestro cliente
|
||||
* @param {*} number
|
||||
*/
|
||||
const sendMessageButton = async (client, number = null, text = null, trigger = null) => {
|
||||
const sendMessageButton = async (client, number = null, text = null, actionButtons) => {
|
||||
number = cleanNumber(number)
|
||||
const message = text
|
||||
|
||||
let button = new Buttons("holaaaa", [
|
||||
{ body: "Leer" },
|
||||
{ body: "SIII" }
|
||||
], "ssssss", "foonooooter");
|
||||
const { title = null, message = null, footer = null, buttons = [] } = actionButtons;
|
||||
let button = new Buttons(message,[...buttons], title, footer);
|
||||
client.sendMessage(number, button);
|
||||
|
||||
console.log(`⚡⚡⚡ Enviando mensajes....`);
|
||||
|
||||
16
controllers/socket.js
Normal file
16
controllers/socket.js
Normal file
@@ -0,0 +1,16 @@
|
||||
module.exports = (socket) => {
|
||||
return {
|
||||
sendQR:(qr) => {
|
||||
socket.emit('connection_qr',{
|
||||
qr
|
||||
})
|
||||
},
|
||||
sendStatus:() => {
|
||||
socket.emit('connection_status',{
|
||||
a:1
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user