fix(whatsapp.gblib): SEND FILE and WPP providers.
This commit is contained in:
commit
05260c0ee5
3 changed files with 36 additions and 20 deletions
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -1,3 +1,18 @@
|
||||||
|
## [2.0.174](https://github.com/GeneralBots/BotServer/compare/2.0.173...2.0.174) (2022-09-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **whatsapp.gblib:** .gbapp message subprocessing. ([c14a766](https://github.com/GeneralBots/BotServer/commit/c14a766047ec1cad9e52104a52a10afb93b8fd71))
|
||||||
|
|
||||||
|
## [2.0.173](https://github.com/GeneralBots/BotServer/compare/2.0.172...2.0.173) (2022-09-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **whatsapp.gblib:** .gbapp message subprocessing. ([e72b030](https://github.com/GeneralBots/BotServer/commit/e72b030e9554c6d442de643f73e9a3f19460973f))
|
||||||
|
* **whatsapp.gblib:** .gbapp message subprocessing. ([9c00ddd](https://github.com/GeneralBots/BotServer/commit/9c00dddd78eeebe6ef8b156f3cc9a044c7756b1c))
|
||||||
|
|
||||||
## [2.0.172](https://github.com/GeneralBots/BotServer/compare/2.0.171...2.0.172) (2022-09-01)
|
## [2.0.172](https://github.com/GeneralBots/BotServer/compare/2.0.171...2.0.172) (2022-09-01)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "botserver",
|
"name": "botserver",
|
||||||
"version": "2.0.172",
|
"version": "2.0.174",
|
||||||
"description": "General Bot Community Edition open-core server.",
|
"description": "General Bot Community Edition open-core server.",
|
||||||
"main": "./boot.js",
|
"main": "./boot.js",
|
||||||
"bugs": "https://github.com/pragmatismo-io/BotServer/issues",
|
"bugs": "https://github.com/pragmatismo-io/BotServer/issues",
|
||||||
|
|
|
@ -237,11 +237,12 @@ export class WhatsappDirectLine extends GBService {
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
GBServer.globals.server.use(`/audios`, express.static('work'));
|
GBServer.globals.server.use(`/audios`, express.static('work'));
|
||||||
|
|
||||||
|
if (options) {
|
||||||
try {
|
try {
|
||||||
const res = await request.post(options);
|
await request.post(options);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
GBLog.error(`Error initializing 3rd party Whatsapp provider(1) ${error.message}`);
|
GBLog.error(`Error initializing 3rd party Whatsapp provider(1) ${error.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -754,13 +755,13 @@ export class WhatsappDirectLine extends GBService {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (options) {
|
||||||
|
try {
|
||||||
// tslint:disable-next-line: await-promise
|
const result = await request.post(options);
|
||||||
const result = await request.post(options);
|
GBLog.info(`Audio ${url} sent to ${to}: ${result}`);
|
||||||
GBLog.info(`Audio ${url} sent to ${to}: ${result}`);
|
} catch (error) {
|
||||||
} catch (error) {
|
GBLog.error(`Error sending audio message to Whatsapp provider ${error.message}`);
|
||||||
GBLog.error(`Error sending audio message to Whatsapp provider ${error.message}`);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -829,16 +830,16 @@ export class WhatsappDirectLine extends GBService {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (options) {
|
||||||
GBLog.info(`Message [${msg}] is being sent to ${to}...`);
|
try {
|
||||||
// tslint:disable-next-line: await-promise
|
GBLog.info(`Message [${msg}] is being sent to ${to}...`);
|
||||||
if (this.provider !== "GeneralBots") {
|
|
||||||
await request.post(options);
|
await request.post(options);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
catch (error) {
|
||||||
GBLog.error(`Error sending message to Whatsapp provider ${error.message}`);
|
GBLog.error(`Error sending message to Whatsapp provider ${error.message}`);
|
||||||
|
|
||||||
// TODO: Handle Error: socket hang up and retry.
|
// TODO: Handle Error: socket hang up and retry.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue