mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
ajustes wa oficial
This commit is contained in:
parent
cf3ec2b601
commit
9bf18592fc
@ -199,10 +199,10 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
const message = received.messages[0];
|
const message = received.messages[0];
|
||||||
if (message.from === received.metadata.phone_number_id) {
|
if (message.from === received.metadata.phone_number_id) {
|
||||||
content = { extendedTextMessage: { text: message.text.body } };
|
content = { extendedTextMessage: { text: message.text.body } };
|
||||||
message.context ? (content.extendedTextMessage.contextInfo = { stanzaId: message.context.id }) : content;
|
message.context ? (content.contextInfo = { stanzaId: message.context.id }) : content;
|
||||||
} else {
|
} else {
|
||||||
content = { conversation: message.text.body };
|
content = { conversation: message.text.body };
|
||||||
message.context ? (content.extendedTextMessage = { contextInfo: { stanzaId: message.context.id } }) : content;
|
message.context ? (content = { contextInfo: { stanzaId: message.context.id } }) : content;
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
@ -377,6 +377,7 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
this.logger.log(messageRaw);
|
this.logger.log(messageRaw);
|
||||||
|
|
||||||
this.logger.verbose('Sending data to webhook in event MESSAGES_UPSERT');
|
this.logger.verbose('Sending data to webhook in event MESSAGES_UPSERT');
|
||||||
|
|
||||||
this.sendDataWebhook(Events.MESSAGES_UPSERT, messageRaw);
|
this.sendDataWebhook(Events.MESSAGES_UPSERT, messageRaw);
|
||||||
|
|
||||||
if (this.localChatwoot.enabled) {
|
if (this.localChatwoot.enabled) {
|
||||||
@ -613,7 +614,7 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
message_id: message['reactionMessage']['key']['id'],
|
message_id: message['reactionMessage']['key']['id'],
|
||||||
emoji: message['reactionMessage']['text'],
|
emoji: message['reactionMessage']['text'],
|
||||||
},
|
},
|
||||||
context: { message_id: quoted.id },
|
// context: { message_id: quoted.id },
|
||||||
};
|
};
|
||||||
quoted ? (content.context = { message_id: quoted.id }) : content;
|
quoted ? (content.context = { message_id: quoted.id }) : content;
|
||||||
return await this.post(content, 'messages');
|
return await this.post(content, 'messages');
|
||||||
@ -673,6 +674,7 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
[message['mediaType']]: {
|
[message['mediaType']]: {
|
||||||
[message['type']]: message['id'],
|
[message['type']]: message['id'],
|
||||||
preview_url: linkPreview,
|
preview_url: linkPreview,
|
||||||
|
caption: message['caption'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
quoted ? (content.context = { message_id: quoted.id }) : content;
|
quoted ? (content.context = { message_id: quoted.id }) : content;
|
||||||
@ -774,6 +776,11 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
if (messageSent?.error?.message) {
|
||||||
|
this.logger.error(messageSent.error.message);
|
||||||
|
throw messageSent.error.message.toString();
|
||||||
|
}
|
||||||
|
|
||||||
const messageRaw: MessageRaw = {
|
const messageRaw: MessageRaw = {
|
||||||
key: { fromMe: true, id: messageSent?.messages[0]?.id, remoteJid: this.createJid(number) },
|
key: { fromMe: true, id: messageSent?.messages[0]?.id, remoteJid: this.createJid(number) },
|
||||||
//pushName: messageSent.pushName,
|
//pushName: messageSent.pushName,
|
||||||
|
Loading…
Reference in New Issue
Block a user