From 1d83e2c7a2d51b887e90d06d51257bfe82f86ce7 Mon Sep 17 00:00:00 2001 From: Francis Breit Date: Sun, 1 Oct 2023 16:19:43 -0300 Subject: [PATCH] =?UTF-8?q?2=20-=20Start=20Typebot=20com=20opcao=20de=20at?= =?UTF-8?q?ivar=20chatbot=20ou=20n=C3=A3o.Update=20typebot.service.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Atualizado para que a variável enabled_typebot não seja obrigatória, compatibilizando com requisições de versões antigas da Evolution API. - Se omitida a variável enabled_typebot , será assumida como true, ou seja, start tybebot com chatbot ativado - Se setada como true, o flow disparado é ativado como chatbot (original do Typebot), porém se false, dispara apenas como se fosse uma notificação e nao ativa o bot. --- src/whatsapp/services/typebot.service.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/whatsapp/services/typebot.service.ts b/src/whatsapp/services/typebot.service.ts index 642ded3b..1bb9abb3 100644 --- a/src/whatsapp/services/typebot.service.ts +++ b/src/whatsapp/services/typebot.service.ts @@ -118,7 +118,10 @@ export class TypebotService { prefilledVariables[variable.name] = variable.value; }); // linha incluida por Francis: - if (enabled_typebot === true) { + if (enabled_typebot !== false ) { + + let enabled_typebot = true; + const response = await this.createNewSession(instance, { url: url, @@ -191,6 +194,23 @@ const id = Math.floor(Math.random() * 10000000000).toString(); } + + + + + + + + + + + + + + + + + // ate aqui return {