From 603197cdc8e72a19b7aa6609439c96db1e97f9a9 Mon Sep 17 00:00:00 2001 From: Luis-Fernando <136400011+Azzybot@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:54:28 -0300 Subject: [PATCH] Update typebot.service.ts --- src/whatsapp/services/typebot.service.ts | 29 +----------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/whatsapp/services/typebot.service.ts b/src/whatsapp/services/typebot.service.ts index b95d0029..a19e1455 100644 --- a/src/whatsapp/services/typebot.service.ts +++ b/src/whatsapp/services/typebot.service.ts @@ -295,34 +295,7 @@ export class TypebotService { // Obtém os tipos de mensagem e o tipo identificado 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) { this.logger.verbose('get message content'); const typeKey = Object.keys(types).find((key) => types[key] !== undefined);