fix(basic.gblib): GBAI automatic retrieval.
This commit is contained in:
parent
335120f1d7
commit
6992bf0ae5
1 changed files with 3 additions and 3 deletions
|
@ -47,6 +47,7 @@ import qrcode from 'qrcode-terminal';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import { GBSSR } from '../../core.gbapp/services/GBSSR.js';
|
import { GBSSR } from '../../core.gbapp/services/GBSSR.js';
|
||||||
import pkg from 'whatsapp-web.js';
|
import pkg from 'whatsapp-web.js';
|
||||||
|
import { DialogKeywords } from 'packages/basic.gblib/services/DialogKeywords.js';
|
||||||
const { List, Buttons, Client, MessageMedia } = pkg;
|
const { List, Buttons, Client, MessageMedia } = pkg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -130,8 +131,8 @@ export class WhatsappDirectLine extends GBService {
|
||||||
case 'GeneralBots':
|
case 'GeneralBots':
|
||||||
const minBoot = GBServer.globals.minBoot;
|
const minBoot = GBServer.globals.minBoot;
|
||||||
// Initialize the browser using a local profile for each bot.
|
// Initialize the browser using a local profile for each bot.
|
||||||
const gbaiName = `${this.min.botId}.gbai`;
|
const path = DialogKeywords.getGBAIPath(this.min.botId);
|
||||||
const localName = Path.join('work', gbaiName, 'profile');
|
const localName = Path.join('work', path, 'profile');
|
||||||
const createClient = () => {
|
const createClient = () => {
|
||||||
const client = (this.customClient = new Client({
|
const client = (this.customClient = new Client({
|
||||||
puppeteer: GBSSR.preparePuppeteer(localName)
|
puppeteer: GBSSR.preparePuppeteer(localName)
|
||||||
|
@ -154,7 +155,6 @@ 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(min., null, null, null);
|
// const s = new DialogKeywords(min., null, null, null);
|
||||||
// const qrBuf = await s.getQRCode(qr);
|
// const qrBuf = await s.getQRCode(qr);
|
||||||
// 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`);
|
||||||
// fs.writeFileSync(localName, qrBuf);
|
// fs.writeFileSync(localName, qrBuf);
|
||||||
// const url = urlJoin(
|
// const url = urlJoin(
|
||||||
|
|
Loading…
Add table
Reference in a new issue