fix: fix inject port args

This commit is contained in:
Leifer Mendez
2023-01-09 22:26:34 +01:00
parent dfc7847573
commit 20f752e6c1
4 changed files with 22 additions and 17 deletions

View File

@@ -19,13 +19,15 @@ const logger = new Console({
* https://github.com/pedroslopez/whatsapp-web.js
*/
class WebWhatsappProvider extends ProviderClass {
globalVendorArgs = { qrFile: 'qr.png' }
globalVendorArgs = { name: `bot` }
vendor
constructor(args) {
super()
this.globalVendorArgs = { ...this.globalVendorArgs, ...args }
this.vendor = new Client({
authStrategy: new LocalAuth(),
authStrategy: new LocalAuth({
clientId: `${this.globalVendorArgs.name}_sessions`,
}),
puppeteer: {
headless: true,
args: [
@@ -75,7 +77,7 @@ class WebWhatsappProvider extends ProviderClass {
`Necesitas ayuda: https://link.codigoencasa.com/DISCORD`,
],
})
await wwebGenerateImage(qr)
await wwebGenerateImage(qr, `${this.globalVendorArgs.name}.png`)
},
},
{