mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 09:51:24 -06:00
ajustes wa business
This commit is contained in:
parent
aa5ed13752
commit
f11d468e31
@ -5,6 +5,7 @@
|
|||||||
* Correction when sending files with captions on Whatsapp Business
|
* Correction when sending files with captions on Whatsapp Business
|
||||||
* Correction in receiving messages with response on WhatsApp Business
|
* Correction in receiving messages with response on WhatsApp Business
|
||||||
* Correction when sending a reaction to a message on WhatsApp Business
|
* Correction when sending a reaction to a message on WhatsApp Business
|
||||||
|
* Correction of receiving reactions on WhatsApp business
|
||||||
* Removed mandatory description of rows from sendList
|
* Removed mandatory description of rows from sendList
|
||||||
* Feature to collect message type in typebot
|
* Feature to collect message type in typebot
|
||||||
|
|
||||||
|
@ -194,6 +194,20 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private messageReactionJson(received: any) {
|
||||||
|
const message = received.messages[0];
|
||||||
|
let content: any = {
|
||||||
|
reactionMessage: {
|
||||||
|
key: {
|
||||||
|
id: message.reaction.message_id,
|
||||||
|
},
|
||||||
|
text: message.reaction.emoji,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
message.context ? (content = { ...content, contextInfo: { stanzaId: message.context.id } }) : content;
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
private messageTextJson(received: any) {
|
private messageTextJson(received: any) {
|
||||||
let content: any;
|
let content: any;
|
||||||
const message = received.messages[0];
|
const message = received.messages[0];
|
||||||
@ -344,6 +358,18 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
owner: this.instance.name,
|
owner: this.instance.name,
|
||||||
// source: getDevice(received.key.id),
|
// source: getDevice(received.key.id),
|
||||||
};
|
};
|
||||||
|
} else if (received?.messages[0].reaction) {
|
||||||
|
messageRaw = {
|
||||||
|
key,
|
||||||
|
pushName,
|
||||||
|
message: {
|
||||||
|
...this.messageReactionJson(received),
|
||||||
|
},
|
||||||
|
messageType: 'reactionMessage',
|
||||||
|
messageTimestamp: received.messages[0].timestamp as number,
|
||||||
|
owner: this.instance.name,
|
||||||
|
// source: getDevice(received.key.id),
|
||||||
|
};
|
||||||
} else if (received?.messages[0].contacts) {
|
} else if (received?.messages[0].contacts) {
|
||||||
messageRaw = {
|
messageRaw = {
|
||||||
key,
|
key,
|
||||||
@ -1205,6 +1231,10 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async deleteMessage() {
|
||||||
|
throw new BadRequestException('Method not available on WhatsApp Business API');
|
||||||
|
}
|
||||||
|
|
||||||
// methods not available on WhatsApp Business API
|
// methods not available on WhatsApp Business API
|
||||||
public async mediaSticker() {
|
public async mediaSticker() {
|
||||||
throw new BadRequestException('Method not available on WhatsApp Business API');
|
throw new BadRequestException('Method not available on WhatsApp Business API');
|
||||||
@ -1227,9 +1257,6 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
public async archiveChat() {
|
public async archiveChat() {
|
||||||
throw new BadRequestException('Method not available on WhatsApp Business API');
|
throw new BadRequestException('Method not available on WhatsApp Business API');
|
||||||
}
|
}
|
||||||
public async deleteMessage() {
|
|
||||||
throw new BadRequestException('Method not available on WhatsApp Business API');
|
|
||||||
}
|
|
||||||
public async fetchProfile() {
|
public async fetchProfile() {
|
||||||
throw new BadRequestException('Method not available on WhatsApp Business API');
|
throw new BadRequestException('Method not available on WhatsApp Business API');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user