fix: chatbot integrations send media and links

This commit is contained in:
Davidson Gomes
2024-09-22 08:53:10 -03:00
parent 3527e662e1
commit 5ebebbf211
6 changed files with 334 additions and 156 deletions

View File

@@ -739,19 +739,24 @@ export class BaileysStartupService extends ChannelStartupService {
},
});
const instance = { instanceName: this.instance.name, instanceId: this.instance.id };
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED && this.localChatwoot?.enabled) {
const instance = { instanceName: this.instance.name, instanceId: this.instance.id };
const findParticipant = await this.chatwootService.findContact(instance, contact.remoteJid.split('@')[0]);
const findParticipant = await this.chatwootService.findContact(
instance,
contact.remoteJid.split('@')[0],
);
if (!findParticipant) {
return;
if (!findParticipant) {
return;
}
this.chatwootService.updateContact(instance, findParticipant.id, {
name: contact.pushName,
avatar_url: contact.profilePicUrl,
});
}
this.chatwootService.updateContact(instance, findParticipant.id, {
name: contact.pushName,
avatar_url: contact.profilePicUrl,
});
return update;
}),
);