2 - Start Typebot com opcao de ativar chatbot ou não.Update typebot.service.ts

- 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.
This commit is contained in:
Francis Breit 2023-10-01 16:19:43 -03:00 committed by GitHub
parent f0ff4873b5
commit 1d83e2c7a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {