fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit 5bf81735e8 - Show all commits

View file

@ -47,7 +47,7 @@ import { GBConfigService } from '../../core.gbapp/services/GBConfigService.js';
import qrcode from 'qrcode-terminal';
import express from 'express';
import { GBSSR } from '../../core.gbapp/services/GBSSR.js';
import pkg from 'whatsapp-web.js';
import pkg, { WAState } from 'whatsapp-web.js';
import { DialogKeywords } from '../../basic.gblib/services/DialogKeywords.js';
import { ChatServices } from '../../gpt.gblib/services/ChatServices.js';
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService.js';
@ -908,7 +908,14 @@ export class WhatsappDirectLine extends GBService {
to = to + '@c.us';
}
}
if (await this.customClient.getState() === WAState.CONNECTED)
{
await this.customClient.sendMessage(to, msg);
}
else
{
GBLog.info(`WhatsApp OFFLINE ${to}: ${msg}`);
}
break;