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) {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ export class WhatsappDirectLine extends GBService {
|
|||
const browser = await createBrowser(profilePath);
|
||||
this.browserWSEndpoint = await browser.wsEndpoint();
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.browserWSEndpoint = browserWSEndpoint;
|
||||
}
|
||||
|
||||
|
@ -181,17 +181,21 @@ export class WhatsappDirectLine extends GBService {
|
|||
// While handling other bots uses boot instance of this class to send QR Codes.
|
||||
|
||||
const s = new DialogKeywords(this.min, null, null, null);
|
||||
const qrBuf = await s.getQRCode(qr);
|
||||
const gbaiName = `${this.min.botId}.gbai`;
|
||||
const localName = Path.join('work', gbaiName, 'cache', `qr${GBAdminService.getRndReadableIdentifier()}.png`);
|
||||
fs.writeFileSync(localName, qrBuf);
|
||||
const url = urlJoin(
|
||||
GBServer.globals.publicAddress,
|
||||
this.min.botId,
|
||||
'cache',
|
||||
Path.basename(localName)
|
||||
);
|
||||
GBServer.globals.minBoot.whatsAppDirectLine.sendFileToDevice(adminNumber, url, Path.basename(localName), msg);
|
||||
if (minBoot.botId !== this.botId) {
|
||||
const qrBuf = await s.getQRCode(qr);
|
||||
const gbaiName = `${this.min.botId}.gbai`;
|
||||
const localName = Path.join('work', gbaiName, 'cache', `qr${GBAdminService.getRndReadableIdentifier()}.png`);
|
||||
fs.writeFileSync(localName, qrBuf);
|
||||
const url = urlJoin(
|
||||
GBServer.globals.publicAddress,
|
||||
this.min.botId,
|
||||
'cache',
|
||||
Path.basename(localName)
|
||||
);
|
||||
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);
|
||||
|
||||
}).bind(this));
|
||||
|
|
Loading…
Add table
Reference in a new issue