new(basic.gblib): New batch features.
This commit is contained in:
parent
fb3325bbb7
commit
14b3ff1fe1
2 changed files with 10 additions and 9 deletions
|
@ -698,7 +698,9 @@ export class GBConversationalService {
|
||||||
}
|
}
|
||||||
|
|
||||||
GBLogEx.info(min, `Sending answer file to mobile: ${mobile}. Header: ${urlImage}`);
|
GBLogEx.info(min, `Sending answer file to mobile: ${mobile}. Header: ${urlImage}`);
|
||||||
|
|
||||||
await this.sendToMobile(min, mobile, data, null);
|
await this.sendToMobile(min, mobile, data, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
// tslint:enable:no-unsafe-any
|
// tslint:enable:no-unsafe-any
|
||||||
|
|
||||||
|
|
|
@ -226,13 +226,6 @@ export class WhatsappDirectLine extends GBService {
|
||||||
|
|
||||||
if (setUrl && options && this.whatsappServiceUrl) {
|
if (setUrl && options && this.whatsappServiceUrl) {
|
||||||
GBServer.globals.server.use(`/audios`, express.static('work'));
|
GBServer.globals.server.use(`/audios`, express.static('work'));
|
||||||
|
|
||||||
if (options) {
|
|
||||||
try {
|
|
||||||
} catch (error) {
|
|
||||||
GBLog.error(`Error initializing 3rd party Whatsapp provider(1) ${error.message}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -612,7 +605,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
watermark = response.obj.watermark;
|
watermark = response.obj.watermark;
|
||||||
await this.printMessages(response.obj.activities, conversationId, from, fromName);
|
await this.printMessages(response.obj.activities, conversationId, from, fromName);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
GBLog.error(`Error calling printMessages on Whatsapp channel ${JSON.stringify(error)}`);
|
GBLog.error(`Error calling printMessages on Whatsapp channel ${GBUtil.toYAML(error)}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
setInterval(worker, this.pollInterval);
|
setInterval(worker, this.pollInterval);
|
||||||
|
@ -739,6 +732,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendToDevice(to: any, msg: string, conversationId) {
|
public async sendToDevice(to: any, msg: string, conversationId) {
|
||||||
|
try{
|
||||||
const cmd = '/audio ';
|
const cmd = '/audio ';
|
||||||
let url;
|
let url;
|
||||||
let chatId = WhatsappDirectLine.chatIds[conversationId];
|
let chatId = WhatsappDirectLine.chatIds[conversationId];
|
||||||
|
@ -823,6 +817,11 @@ export class WhatsappDirectLine extends GBService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
} catch (error) {
|
||||||
|
GBLog.error(`GBWhatsApp ERR: ${GBUtil.toYAML(error)}`);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendToDeviceEx(to, text, locale, conversationId) {
|
public async sendToDeviceEx(to, text, locale, conversationId) {
|
||||||
|
@ -1092,7 +1091,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
GBLog.error(`Error on Whatsapp callback: ${JSON.stringify(error)}`);
|
GBLog.error(`Error on Whatsapp callback: ${GBUtil.toYAML(error)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue