chatwoot now receives messages sent via api and typebot

This commit is contained in:
Davidson Gomes 2023-10-02 17:59:54 -03:00
parent f5eeb16bb1
commit 33acfe1464
3 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,8 @@
* Improvement in restart instance to completely redo the connection
* Update node version: v20
* Correction of messages sent by the api and typebot not appearing in chatwoot
* Adjustment to start typebot, added startSession parameter
* Chatwoot now receives messages sent via api and typebot
# 1.5.2 (2023-09-28 17:56)

View File

@ -1132,7 +1132,7 @@ export class ChatwootService {
thumbnailUrl: string;
sourceUrl: string;
}
const adsMessage: AdsMessage | undefined = msg.extendedTextMessage?.contextInfo.externalAdReply;
const adsMessage: AdsMessage | undefined = msg.extendedTextMessage?.contextInfo?.externalAdReply;
this.logger.verbose('Get ads message if it exist');
adsMessage && this.logger.verbose('Ads message: ' + adsMessage);
@ -1279,7 +1279,7 @@ export class ChatwootService {
return null;
}
if (event === 'messages.upsert' || event === 'send.messages') {
if (event === 'messages.upsert' || event === 'send.message') {
this.logger.verbose('event messages.upsert');
if (body.key.remoteJid === 'status@broadcast') {

View File

@ -233,7 +233,7 @@ export class TypebotService {
prefilledVariables: {
...data.prefilledVariables,
remoteJid: data.remoteJid,
pushName: data.pushName || 'Default Name',
pushName: data.pushName || '',
instanceName: instance.instanceName,
},
},
@ -251,7 +251,7 @@ export class TypebotService {
prefilledVariables: {
...data.prefilledVariables,
remoteJid: data.remoteJid,
pushName: data.pushName || 'Default Name',
pushName: data.pushName || '',
instanceName: instance.instanceName,
},
});