mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-17 04:32:53 -06:00
feat: Save picture url groups in chatwoot
This commit is contained in:
parent
7f4c9b5b11
commit
d4766f9c81
@ -43,6 +43,12 @@ export class ChatwootService {
|
|||||||
this.logger.verbose('message cache saved');
|
this.logger.verbose('message cache saved');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private clearMessageCache() {
|
||||||
|
this.logger.verbose('clear message cache');
|
||||||
|
this.messageCache.clear();
|
||||||
|
this.saveMessageCache();
|
||||||
|
}
|
||||||
|
|
||||||
private async getProvider(instance: InstanceDto) {
|
private async getProvider(instance: InstanceDto) {
|
||||||
this.logger.verbose('get provider to instance: ' + instance.instanceName);
|
this.logger.verbose('get provider to instance: ' + instance.instanceName);
|
||||||
try {
|
try {
|
||||||
@ -465,7 +471,9 @@ export class ChatwootService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const contactId = contact.id || contact.payload.contact.id;
|
console.log(contact);
|
||||||
|
|
||||||
|
const contactId = contact.payload.id || contact.payload.contact.id;
|
||||||
|
|
||||||
if (!body.key.fromMe && contact.name === chatId && nameContact !== chatId) {
|
if (!body.key.fromMe && contact.name === chatId && nameContact !== chatId) {
|
||||||
this.logger.verbose('update contact name in chatwoot');
|
this.logger.verbose('update contact name in chatwoot');
|
||||||
@ -1002,6 +1010,9 @@ export class ChatwootService {
|
|||||||
return { message: 'bot' };
|
return { message: 'bot' };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.logger.verbose('clear cache');
|
||||||
|
this.clearMessageCache();
|
||||||
|
|
||||||
this.logger.verbose('Format message to send');
|
this.logger.verbose('Format message to send');
|
||||||
let formatText: string;
|
let formatText: string;
|
||||||
if (senderName === null || senderName === undefined) {
|
if (senderName === null || senderName === undefined) {
|
||||||
@ -1158,6 +1169,7 @@ export class ChatwootService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event === 'messages.upsert') {
|
if (event === 'messages.upsert') {
|
||||||
|
console.log(body);
|
||||||
this.logger.verbose('event messages.upsert');
|
this.logger.verbose('event messages.upsert');
|
||||||
|
|
||||||
if (body.key.remoteJid === 'status@broadcast') {
|
if (body.key.remoteJid === 'status@broadcast') {
|
||||||
|
Loading…
Reference in New Issue
Block a user