integramos Baileys y varios cambios,

This commit is contained in:
2023-02-21 18:49:07 -06:00
parent 3518f516e0
commit fe8d0f7648
17 changed files with 935 additions and 1360 deletions

View File

@@ -14,7 +14,7 @@ app.use('/', require('../routes/web'))
initBot = async () => {
console.log("WaWebJS Init")
client = new Client({
const client = new Client({
authStrategy: new LocalAuth(),
puppeteer: { headless: true, args: ['--no-sandbox','--disable-setuid-sandbox'] }
});
@@ -59,16 +59,4 @@ initBot = async () => {
return client
}
/**
* Regresa las variables from, body, name y hasMedia de el objeto del mensaje.
* @param {*} msg
* @returns from, body, name, hasMedia
*/
function traeVariables(msg){
const { from, body, hasMedia } = msg;
let name = msg?._data?.notifyName
// console.log("fromBody=", msg?._data)
return {"from":from, "body":body, "name":name, "hasMedia":hasMedia}
}
module.exports = { initBot, traeVariables }
module.exports = { initBot }