File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/api/integrations/chatbot/chatwoot/services Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1898,6 +1898,12 @@ export class ChatwootService {
18981898
18991899 public async eventWhatsapp ( event : string , instance : InstanceDto , body : any ) {
19001900 try {
1901+ // Ignora eventos que não são mensagens (como EPHEMERAL_SYNC_RESPONSE)
1902+ if ( body ?. type && body . type !== 'message' && body . type !== 'conversation' ) {
1903+ this . logger . verbose ( `Ignoring non-message event type: ${ body . type } ` ) ;
1904+ return ;
1905+ }
1906+
19011907 const waInstance = this . waMonitor . waInstances [ instance . instanceName ] ;
19021908
19031909 if ( ! waInstance ) {
@@ -2270,6 +2276,12 @@ export class ChatwootService {
22702276 }
22712277
22722278 if ( event === 'messages.edit' || event === 'send.message.update' ) {
2279+ // Ignora eventos que não são mensagens (como EPHEMERAL_SYNC_RESPONSE)
2280+ if ( body ?. type && body . type !== 'message' ) {
2281+ this . logger . verbose ( `Ignoring non-message event type: ${ body . type } ` ) ;
2282+ return ;
2283+ }
2284+
22732285 if ( ! body ?. key ?. id ) {
22742286 this . logger . warn ( `body.key.id is null or undefined in messages.edit. Full body object: ${ JSON . stringify ( body ) } ` ) ;
22752287 return ;
You can’t perform that action at this time.
0 commit comments