Update typebot.service.ts

This commit is contained in:
Luis-Fernando 2024-03-28 21:37:20 -03:00 committed by GitHub
parent a85971c390
commit 893e290b15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -270,7 +270,6 @@ export class TypebotService {
private getTypeMessage(msg: any) { private getTypeMessage(msg: any) {
this.logger.verbose('get type message'); this.logger.verbose('get type message');
const types = { const types = {
conversation: msg.conversation, conversation: msg.conversation,
extendedTextMessage: msg.extendedTextMessage?.text, extendedTextMessage: msg.extendedTextMessage?.text,
@ -283,10 +282,12 @@ export class TypebotService {
viewOnceMessageV2: msg.viewOnceMessageV2?.message?.imageMessage?.url, viewOnceMessageV2: msg.viewOnceMessageV2?.message?.imageMessage?.url,
listResponseMessage: msg.listResponseMessage?.singleSelectReply?.selectedRowId, listResponseMessage: msg.listResponseMessage?.singleSelectReply?.selectedRowId,
responseRowId: msg.listResponseMessage?.singleSelectReply?.selectedRowId, responseRowId: msg.listResponseMessage?.singleSelectReply?.selectedRowId,
UNKNOWN: 'unknown',
}; };
this.logger.verbose('type message: ' + JSON.stringify(types)); types['messageType'] = Object.keys(types).find((key) => types[key] !== undefined) || 'UNKNOWN';
this.logger.verbose('type message: ' + JSON.stringify(types));
return types; return types;
} }