From 48e7a410a2d3ce0900450d8cba9626d0ac6e8592 Mon Sep 17 00:00:00 2001 From: Francis Breit Date: Mon, 2 Oct 2023 10:49:04 -0300 Subject: [PATCH] Update typebot.service.ts --- src/whatsapp/services/typebot.service.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/whatsapp/services/typebot.service.ts b/src/whatsapp/services/typebot.service.ts index ac157b25..b8d8684c 100644 --- a/src/whatsapp/services/typebot.service.ts +++ b/src/whatsapp/services/typebot.service.ts @@ -99,7 +99,6 @@ export class TypebotService { const remoteJid = data.remoteJid; const url = data.url; const typebot = data.typebot; - // linha incluida por Francis: const enabled_typebot = data.enabled_typebot; const variables = data.variables; const findTypebot = await this.find(instance); @@ -117,7 +116,7 @@ export class TypebotService { variables.forEach((variable) => { prefilledVariables[variable.name] = variable.value; }); - // linha incluida por Francis: + if (enabled_typebot !== false ) { let enabled_typebot = true; @@ -125,7 +124,6 @@ export class TypebotService { const response = await this.createNewSession(instance, { url: url, - // linha incluida por Francis enabled_typebot: enabled_typebot, typebot: typebot, remoteJid: remoteJid, @@ -150,7 +148,6 @@ const response = await this.createNewSession(instance, { this.waMonitor.waInstances[instance.instanceName].sendDataWebhook(Events.TYPEBOT_START, { remoteJid: remoteJid, url: url, - // linha incluida por Francis: enabled_typebot: enabled_typebot, typebot: typebot, prefilledVariables: prefilledVariables, @@ -193,15 +190,10 @@ const id = Math.floor(Math.random() * 10000000000).toString(); } - - - // ate aqui - return { typebot: { ...instance, typebot: { - // linha incluida por Francis: enabled_typebot: enabled_typebot, url: url, remoteJid: remoteJid, @@ -281,8 +273,6 @@ const id = Math.floor(Math.random() * 10000000000).toString(); }); const typebotData = { - // linha incluida por Francis new 4: - // enabled: data.enabled_typebot, enabled: true, url: data.url, typebot: data.typebot, @@ -521,6 +511,7 @@ const id = Math.floor(Math.random() * 10000000000).toString(); }); const typebotData = { + enabled: true, url: url, typebot: typebot, expire: expire,