mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-23 17:08:44 -06:00
fix: integration
This commit is contained in:
parent
703bc310a7
commit
e2c67d7dae
@ -105,7 +105,6 @@ export class InstanceController {
|
|||||||
this.cache,
|
this.cache,
|
||||||
this.chatwootCache,
|
this.chatwootCache,
|
||||||
);
|
);
|
||||||
await this.waMonitor.saveInstance({ integration, instanceName, token, number });
|
|
||||||
} else {
|
} else {
|
||||||
instance = new BaileysStartupService(
|
instance = new BaileysStartupService(
|
||||||
this.configService,
|
this.configService,
|
||||||
@ -116,6 +115,8 @@ export class InstanceController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await this.waMonitor.saveInstance({ integration, instanceName, token, number });
|
||||||
|
|
||||||
instance.instanceName = instanceName;
|
instance.instanceName = instanceName;
|
||||||
|
|
||||||
const instanceId = v4();
|
const instanceId = v4();
|
||||||
|
@ -347,6 +347,8 @@ export class WAMonitoringService {
|
|||||||
this.cache,
|
this.cache,
|
||||||
this.chatwootCache,
|
this.chatwootCache,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
instance.instanceName = name;
|
||||||
} else {
|
} else {
|
||||||
instance = new BaileysStartupService(
|
instance = new BaileysStartupService(
|
||||||
this.configService,
|
this.configService,
|
||||||
@ -355,8 +357,14 @@ export class WAMonitoringService {
|
|||||||
this.cache,
|
this.cache,
|
||||||
this.chatwootCache,
|
this.chatwootCache,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
instance.instanceName = name;
|
||||||
|
|
||||||
|
if (!integration) {
|
||||||
|
await instance.setIntegration({ integration: Integration.WHATSAPP_BAILEYS });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
instance.instanceName = name;
|
|
||||||
this.logger.verbose('Instance loaded: ' + name);
|
this.logger.verbose('Instance loaded: ' + name);
|
||||||
await instance.connectToWhatsapp();
|
await instance.connectToWhatsapp();
|
||||||
this.logger.verbose('connectToWhatsapp: ' + name);
|
this.logger.verbose('connectToWhatsapp: ' + name);
|
||||||
|
@ -2020,13 +2020,22 @@ export class BaileysStartupService extends WAStartupService {
|
|||||||
if (mediaMessage.mimetype) {
|
if (mediaMessage.mimetype) {
|
||||||
mimetype = mediaMessage.mimetype;
|
mimetype = mediaMessage.mimetype;
|
||||||
} else {
|
} else {
|
||||||
if (isURL(mediaMessage.media)) {
|
mimetype = getMIMEType(mediaMessage.fileName);
|
||||||
|
|
||||||
|
if (!mimetype && isURL(mediaMessage.media)) {
|
||||||
const response = await axios.get(mediaMessage.media, { responseType: 'arraybuffer' });
|
const response = await axios.get(mediaMessage.media, { responseType: 'arraybuffer' });
|
||||||
|
|
||||||
mimetype = response.headers['content-type'];
|
mimetype = response.headers['content-type'];
|
||||||
} else {
|
|
||||||
mimetype = getMIMEType(mediaMessage.fileName);
|
|
||||||
}
|
}
|
||||||
|
// if (isURL(mediaMessage.media)) {
|
||||||
|
// const response = await axios.get(mediaMessage.media, { responseType: 'arraybuffer' });
|
||||||
|
|
||||||
|
// mimetype = response.headers['content-type'];
|
||||||
|
// console.log('mediaMessage.mimetype2', mimetype);
|
||||||
|
// } else {
|
||||||
|
// mimetype = getMIMEType(mediaMessage.fileName);
|
||||||
|
// console.log('mediaMessage.mimetype3', mimetype);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.verbose('Mimetype: ' + mimetype);
|
this.logger.verbose('Mimetype: ' + mimetype);
|
||||||
|
Loading…
Reference in New Issue
Block a user