Update typebot.service.ts

This commit is contained in:
Francis Breit 2023-10-02 10:49:04 -03:00 committed by GitHub
parent 5202060812
commit 48e7a410a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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