mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 09:51:24 -06:00
fix: adjusts in messageType
This commit is contained in:
parent
4e160a46dd
commit
763c5de03f
@ -61,6 +61,7 @@
|
||||
"express": "^4.18.2",
|
||||
"express-async-errors": "^3.1.1",
|
||||
"fast-levenshtein": "^3.0.0",
|
||||
"form-data": "^4.0.0",
|
||||
"hbs": "^4.2.0",
|
||||
"https-proxy-agent": "^7.0.2",
|
||||
"i18next": "^23.7.19",
|
||||
|
@ -1,6 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { arrayUnique, isURL } from 'class-validator';
|
||||
import EventEmitter2 from 'eventemitter2';
|
||||
import FormData from 'form-data';
|
||||
import fs from 'fs/promises';
|
||||
import { getMIMEType } from 'node-mime-types';
|
||||
|
||||
@ -298,8 +299,6 @@ export class BusinessStartupService extends WAStartupService {
|
||||
let messageRaw: MessageRaw;
|
||||
let pushName: any;
|
||||
|
||||
console.log('received?.messages[0]', received?.messages[0]);
|
||||
|
||||
if (received.contacts) pushName = received.contacts[0].profile.name;
|
||||
|
||||
if (received.messages) {
|
||||
@ -756,7 +755,6 @@ export class BusinessStartupService extends WAStartupService {
|
||||
return messageRaw;
|
||||
} catch (error) {
|
||||
this.logger.error(error);
|
||||
console.log(error.data);
|
||||
throw new BadRequestException(error.toString());
|
||||
}
|
||||
}
|
||||
@ -779,9 +777,11 @@ export class BusinessStartupService extends WAStartupService {
|
||||
const integration = await this.findIntegration();
|
||||
|
||||
const formData = new FormData();
|
||||
const arquivoBuffer = await fs.readFile(mediaMessage.media);
|
||||
const arquivoBlob = new Blob([arquivoBuffer], { type: mediaMessage.mimetype });
|
||||
formData.append('file', arquivoBlob);
|
||||
|
||||
const fileBuffer = await fs.readFile(mediaMessage.media);
|
||||
|
||||
const fileBlob = new Blob([fileBuffer], { type: mediaMessage.mimetype });
|
||||
formData.append('file', fileBlob);
|
||||
formData.append('typeFile', mediaMessage.mimetype);
|
||||
formData.append('messaging_product', 'whatsapp');
|
||||
const headers = { Authorization: `Bearer ${integration.token}` };
|
||||
|
Loading…
Reference in New Issue
Block a user