new(all): Custom Domain support per bot.

This commit is contained in:
rodrigorodriguez 2022-10-02 13:41:50 -03:00
parent 8909834b82
commit 4c26cc0985

View file

@ -149,16 +149,15 @@ export class WhatsappDirectLine extends GBService {
client.initialize(); client.initialize();
this.browserWSEndpoint = browser.wsEndpoint(); // store for later this.browserWSEndpoint = browser.wsEndpoint(); // store for later
var self = this; browser.on('disconnected', (async () => {
client.on('disconnected', async () => { client.browser = await puppeteer.connect({browserWSEndpoint: this.browserWSEndpoint});
client.browser = await puppeteer.connect({browserWSEndpoint: self.browserWSEndpoint}); }).bind(this));
}).bind(this);
// Dispatches messages to the received method. // Dispatches messages to the received method.
client.on('message', async message => { client.on('message', (async message => {
await this.WhatsAppCallback(message, null); await this.WhatsAppCallback(message, null);
}).bind(this); }).bind(this));
client.on('qr', (async (qr) => { client.on('qr', (async (qr) => {