From 6992bf0ae5e83118a05a267c4f55636f8d081dbb Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Thu, 9 Mar 2023 17:45:59 -0300 Subject: [PATCH] fix(basic.gblib): GBAI automatic retrieval. --- packages/whatsapp.gblib/services/WhatsappDirectLine.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index b6265e41..cc191c9f 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -47,6 +47,7 @@ import qrcode from 'qrcode-terminal'; import express from 'express'; import { GBSSR } from '../../core.gbapp/services/GBSSR.js'; import pkg from 'whatsapp-web.js'; +import { DialogKeywords } from 'packages/basic.gblib/services/DialogKeywords.js'; const { List, Buttons, Client, MessageMedia } = pkg; /** @@ -130,8 +131,8 @@ export class WhatsappDirectLine extends GBService { case 'GeneralBots': const minBoot = GBServer.globals.minBoot; // Initialize the browser using a local profile for each bot. - const gbaiName = `${this.min.botId}.gbai`; - const localName = Path.join('work', gbaiName, 'profile'); + const path = DialogKeywords.getGBAIPath(this.min.botId); + const localName = Path.join('work', path, 'profile'); const createClient = () => { const client = (this.customClient = new Client({ 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. // const s = new DialogKeywords(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(