Skip to content

Commit deb07d2

Browse files
committed
Messages sent by the api now arrive in chatwoot
1 parent 3a14fc3 commit deb07d2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Update Dockerfile
2020
* If you pass empty events in create instance and set webhook it is understood as all
2121
* Fixed issue that did not output base64 averages
22+
* Messages sent by the api now arrive in chatwoot
2223

2324
### Integrations
2425

src/whatsapp/services/whatsapp.service.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ export class WAStartupService {
678678
instance: this.instance.name,
679679
data,
680680
destination: this.localWebhook.url,
681+
ISODatetime: new Date().toISOString(),
681682
sender: this.wuid,
682683
server_url: serverUrl,
683684
apikey: (expose && instanceApikey) || null,
@@ -1991,13 +1992,9 @@ export class WAStartupService {
19911992
this.logger.verbose('Sending data to webhook in event SEND_MESSAGE');
19921993
await this.sendDataWebhook(Events.SEND_MESSAGE, messageRaw);
19931994

1994-
// if (this.localChatwoot.enabled) {
1995-
// this.chatwootService.eventWhatsapp(
1996-
// Events.SEND_MESSAGE,
1997-
// { instanceName: this.instance.name },
1998-
// messageRaw,
1999-
// );
2000-
// }
1995+
if (this.localChatwoot.enabled) {
1996+
this.chatwootService.eventWhatsapp(Events.SEND_MESSAGE, { instanceName: this.instance.name }, messageRaw);
1997+
}
20011998

20021999
this.logger.verbose('Inserting message in database');
20032000
await this.repository.message.insert(

0 commit comments

Comments
 (0)