fix(all): Create bot OK.
This commit is contained in:
parent
777762d58b
commit
5bf81735e8
1 changed files with 9 additions and 2 deletions
|
@ -47,7 +47,7 @@ import { GBConfigService } from '../../core.gbapp/services/GBConfigService.js';
|
||||||
import qrcode from 'qrcode-terminal';
|
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, { WAState } from 'whatsapp-web.js';
|
||||||
import { DialogKeywords } from '../../basic.gblib/services/DialogKeywords.js';
|
import { DialogKeywords } from '../../basic.gblib/services/DialogKeywords.js';
|
||||||
import { ChatServices } from '../../gpt.gblib/services/ChatServices.js';
|
import { ChatServices } from '../../gpt.gblib/services/ChatServices.js';
|
||||||
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService.js';
|
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService.js';
|
||||||
|
@ -908,7 +908,14 @@ export class WhatsappDirectLine extends GBService {
|
||||||
to = to + '@c.us';
|
to = to + '@c.us';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (await this.customClient.getState() === WAState.CONNECTED)
|
||||||
|
{
|
||||||
await this.customClient.sendMessage(to, msg);
|
await this.customClient.sendMessage(to, msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GBLog.info(`WhatsApp OFFLINE ${to}: ${msg}`);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue