mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 03:59:17 +00:00
fix(bot): 🚑 fix callback functions
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
const { ProviderClass } = require('@bot-whatsapp/bot')
|
||||
const venom = require('venom-bot')
|
||||
const { createWriteStream } = require('fs')
|
||||
const { Console } = require('console')
|
||||
|
||||
const {
|
||||
venomCleanNumber,
|
||||
venomGenerateImage,
|
||||
venomisValidNumber,
|
||||
} = require('./utils')
|
||||
|
||||
const logger = new Console({
|
||||
stdout: createWriteStream(`${process.cwd()}/venom.log`),
|
||||
})
|
||||
|
||||
/**
|
||||
* ⚙️ VenomProvider: Es una clase tipo adaptor
|
||||
* que extiende clases de ProviderClass (la cual es como interfaz para sber que funciones rqueridas)
|
||||
@@ -34,13 +41,13 @@ class VenomProvider extends ProviderClass {
|
||||
)
|
||||
this.vendor = client
|
||||
} catch (e) {
|
||||
logger.log(e)
|
||||
this.emit('auth_failure', {
|
||||
instructions: [
|
||||
`Ocurrio un error con la inicializacion de venom`,
|
||||
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
|
||||
`(Puedes abrir un ISSUE) https://github.com/leifermendez/bot-whatsapp/issues/new/choose`,
|
||||
``,
|
||||
`${e?.message}`,
|
||||
`Reinicia el BOT`,
|
||||
`Tambien puedes mirar un log que se ha creado venom.log`,
|
||||
`(Puedes abrir un ISSUE) https://github.com/codigoencasa/bot-whatsapp/issues/new/choose`,
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user