mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 03:56:54 -06:00
fix: adjusts in messageType
This commit is contained in:
parent
1595da789d
commit
d4372a0332
@ -266,10 +266,13 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async renderMessageType(type: string) {
|
private renderMessageType(type: string) {
|
||||||
let messageType: string;
|
let messageType: string;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case 'text':
|
||||||
|
messageType = 'conversation';
|
||||||
|
break;
|
||||||
case 'image':
|
case 'image':
|
||||||
messageType = 'imageMessage';
|
messageType = 'imageMessage';
|
||||||
break;
|
break;
|
||||||
@ -317,7 +320,7 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
...this.messageMediaJson(received),
|
...this.messageMediaJson(received),
|
||||||
base64: buffer ? buffer.toString('base64') : undefined,
|
base64: buffer ? buffer.toString('base64') : undefined,
|
||||||
},
|
},
|
||||||
messageType: await this.renderMessageType(received.messages[0].type),
|
messageType: this.renderMessageType(received.messages[0].type),
|
||||||
messageTimestamp: received.messages[0].timestamp as number,
|
messageTimestamp: received.messages[0].timestamp as number,
|
||||||
owner: this.instance.name,
|
owner: this.instance.name,
|
||||||
// source: getDevice(received.key.id),
|
// source: getDevice(received.key.id),
|
||||||
@ -351,7 +354,7 @@ export class BusinessStartupService extends WAStartupService {
|
|||||||
key,
|
key,
|
||||||
pushName,
|
pushName,
|
||||||
message: this.messageTextJson(received),
|
message: this.messageTextJson(received),
|
||||||
messageType: received.messages[0].type,
|
messageType: this.renderMessageType(received.messages[0].type),
|
||||||
messageTimestamp: received.messages[0].timestamp as number,
|
messageTimestamp: received.messages[0].timestamp as number,
|
||||||
owner: this.instance.name,
|
owner: this.instance.name,
|
||||||
//source: getDevice(received.key.id),
|
//source: getDevice(received.key.id),
|
||||||
|
Loading…
Reference in New Issue
Block a user