new(whatsapp.gblib): Native provider works in groups now.
This commit is contained in:
parent
34414f65ac
commit
f0b996fd68
2 changed files with 18 additions and 14 deletions
|
@ -870,7 +870,7 @@ export class GBVMService extends GBService {
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(`BASIC ERROR: ${error.message ? error.message : error}\n Stack:${error.stack}`);
|
throw new Error(`BASIC RUNTIME ERR: ${error.message ? error.message : error}\n Stack:${error.stack}`);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
const browser = await createBrowser(profilePath);
|
const browser = await createBrowser(profilePath);
|
||||||
this.browserWSEndpoint = await browser.wsEndpoint();
|
this.browserWSEndpoint = await browser.wsEndpoint();
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.browserWSEndpoint = browserWSEndpoint;
|
this.browserWSEndpoint = browserWSEndpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,6 +181,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
// While handling other bots uses boot instance of this class to send QR Codes.
|
// While handling other bots uses boot instance of this class to send QR Codes.
|
||||||
|
|
||||||
const s = new DialogKeywords(this.min, null, null, null);
|
const s = new DialogKeywords(this.min, null, null, null);
|
||||||
|
if (minBoot.botId !== this.botId) {
|
||||||
const qrBuf = await s.getQRCode(qr);
|
const qrBuf = await s.getQRCode(qr);
|
||||||
const gbaiName = `${this.min.botId}.gbai`;
|
const gbaiName = `${this.min.botId}.gbai`;
|
||||||
const localName = Path.join('work', gbaiName, 'cache', `qr${GBAdminService.getRndReadableIdentifier()}.png`);
|
const localName = Path.join('work', gbaiName, 'cache', `qr${GBAdminService.getRndReadableIdentifier()}.png`);
|
||||||
|
@ -192,6 +193,9 @@ export class WhatsappDirectLine extends GBService {
|
||||||
Path.basename(localName)
|
Path.basename(localName)
|
||||||
);
|
);
|
||||||
GBServer.globals.minBoot.whatsAppDirectLine.sendFileToDevice(adminNumber, url, Path.basename(localName), msg);
|
GBServer.globals.minBoot.whatsAppDirectLine.sendFileToDevice(adminNumber, url, Path.basename(localName), msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// The e-mail is sent to all bots.
|
||||||
s.sendEmail(adminEmail, `Check your WhatsApp for bot ${this.botId}`, msg);
|
s.sendEmail(adminEmail, `Check your WhatsApp for bot ${this.botId}`, msg);
|
||||||
|
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
|
|
Loading…
Add table
Reference in a new issue