diff --git a/backend/src/libs/wbot.ts b/backend/src/libs/wbot.ts index 9c926fb..c024161 100644 --- a/backend/src/libs/wbot.ts +++ b/backend/src/libs/wbot.ts @@ -70,10 +70,24 @@ export const initWbot = async (whatsapp: Whatsapp, backupSessionRestore: boolean // }); // usando instancia do chrome + // const wbot: Session = new Client({ + // session: sessionCfg, authStrategy: new LocalAuth({ clientId: 'bd_' + whatsapp.id }), + // // puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], executablePath: process.env.CHROME_BIN || undefined }, + // puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], executablePath: process.env.CHROME_BIN || '/usr/bin/google-chrome-stable' }, + + // }); + + const args:String = process.env.CHROME_ARGS || ""; + const wbot: Session = new Client({ - session: sessionCfg, authStrategy: new LocalAuth({ clientId: 'bd_' + whatsapp.id }), - // puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], executablePath: process.env.CHROME_BIN || undefined }, - puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'], executablePath: process.env.CHROME_BIN || '/usr/bin/google-chrome-stable' }, + session: sessionCfg, + authStrategy: new LocalAuth({ clientId: 'bd_' + whatsapp.id }), + puppeteer: { + executablePath: process.env.CHROME_BIN || undefined, + // @ts-ignore + browserWSEndpoint: process.env.CHROME_WS || undefined, + args: args.split(' ') + } });