mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-27 02:48:39 -06:00
Update typebot.service.ts
This commit is contained in:
parent
7dc3cfb690
commit
603197cdc8
@ -295,34 +295,7 @@ export class TypebotService {
|
|||||||
|
|
||||||
// Obtém os tipos de mensagem e o tipo identificado
|
// Obtém os tipos de mensagem e o tipo identificado
|
||||||
const messageType = this.getTypeMessage(msg.message);
|
const messageType = this.getTypeMessage(msg.message);
|
||||||
|
|
||||||
// Condiciona a lógica com switch-case
|
|
||||||
switch (messageType) {
|
|
||||||
case 'audioMessage':
|
|
||||||
return 'audio';
|
|
||||||
case 'imageMessage':
|
|
||||||
return 'image';
|
|
||||||
case 'videoMessage':
|
|
||||||
return 'video';
|
|
||||||
case 'documentMessage':
|
|
||||||
return 'document';
|
|
||||||
case 'contactMessage':
|
|
||||||
return 'contact';
|
|
||||||
case 'locationMessage':
|
|
||||||
return 'location';
|
|
||||||
case 'viewOnceMessageV2':
|
|
||||||
return 'oneView';
|
|
||||||
case 'listResponseMessage':
|
|
||||||
case 'responseRowId':
|
|
||||||
return 'option';
|
|
||||||
case 'conversation':
|
|
||||||
return 'text';
|
|
||||||
case 'extendedTextMessage':
|
|
||||||
return 'textWeb';
|
|
||||||
default:
|
|
||||||
return 'unknown';
|
|
||||||
}
|
|
||||||
|
|
||||||
private getMessageContent(types: any) {
|
private getMessageContent(types: any) {
|
||||||
this.logger.verbose('get message content');
|
this.logger.verbose('get message content');
|
||||||
const typeKey = Object.keys(types).find((key) => types[key] !== undefined);
|
const typeKey = Object.keys(types).find((key) => types[key] !== undefined);
|
||||||
|
Loading…
Reference in New Issue
Block a user