Messages sent by the api now arrive in chatwoot

This commit is contained in:
Davidson Gomes 2023-08-18 08:44:13 -03:00
parent 3a14fc373a
commit deb07d2b7f
2 changed files with 5 additions and 7 deletions

View File

@ -19,6 +19,7 @@
* Update Dockerfile
* If you pass empty events in create instance and set webhook it is understood as all
* Fixed issue that did not output base64 averages
* Messages sent by the api now arrive in chatwoot
### Integrations

View File

@ -678,6 +678,7 @@ export class WAStartupService {
instance: this.instance.name,
data,
destination: this.localWebhook.url,
ISODatetime: new Date().toISOString(),
sender: this.wuid,
server_url: serverUrl,
apikey: (expose && instanceApikey) || null,
@ -1991,13 +1992,9 @@ export class WAStartupService {
this.logger.verbose('Sending data to webhook in event SEND_MESSAGE');
await this.sendDataWebhook(Events.SEND_MESSAGE, messageRaw);
// if (this.localChatwoot.enabled) {
// this.chatwootService.eventWhatsapp(
// Events.SEND_MESSAGE,
// { instanceName: this.instance.name },
// messageRaw,
// );
// }
if (this.localChatwoot.enabled) {
this.chatwootService.eventWhatsapp(Events.SEND_MESSAGE, { instanceName: this.instance.name }, messageRaw);
}
this.logger.verbose('Inserting message in database');
await this.repository.message.insert(