From 4ca7cfe1c53e760ba5d258365624c700c02a6e6f Mon Sep 17 00:00:00 2001 From: Iago Cotta Date: Fri, 22 May 2026 09:43:57 -0300 Subject: [PATCH 1/2] fix: corrigir controle do evolutionBot por variavel de ambiente --- .env.example | 3 +++ env.example | 3 +++ .../evolutionBot/controllers/evolutionBot.controller.ts | 3 ++- src/config/env.config.ts | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 73a3b40d35..f8a8f4607b 100644 --- a/.env.example +++ b/.env.example @@ -315,6 +315,9 @@ QRCODE_LIMIT=30 # Color of the QRCode on base64 QRCODE_COLOR='#175197' +# EvolutionBot - Environment variables +EVOLUTIONBOT_ENABLED=false + # Typebot - Environment variables TYPEBOT_ENABLED=false # old | latest diff --git a/env.example b/env.example index 5fe448b82c..2e711ab84b 100644 --- a/env.example +++ b/env.example @@ -203,6 +203,9 @@ QRCODE_COLOR=#198754 # INTEGRAÇÕES # =========================================== +# EvolutionBot +EVOLUTIONBOT_ENABLED=false + # Typebot TYPEBOT_ENABLED=false TYPEBOT_API_VERSION=old diff --git a/src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts b/src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts index 13ec5330d7..6100c6f712 100644 --- a/src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts +++ b/src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts @@ -1,5 +1,6 @@ import { PrismaRepository } from '@api/repository/repository.service'; import { WAMonitoringService } from '@api/services/monitor.service'; +import { configService, EvolutionBot as EvolutionBotConfig } from '@config/env.config'; import { Logger } from '@config/logger.config'; import { EvolutionBot, IntegrationSession } from '@prisma/client'; @@ -23,7 +24,7 @@ export class EvolutionBotController extends BaseChatbotController('EVOLUTIONBOT').ENABLED; botRepository: any; settingsRepository: any; sessionRepository: any; diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 7c4e382e7e..236089ce93 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -314,6 +314,7 @@ export type Webhook = { export type Pusher = { ENABLED: boolean; GLOBAL?: GlobalPusher; EVENTS: EventsPusher }; export type ConfigSessionPhone = { CLIENT: string; NAME: string }; export type QrCode = { LIMIT: number; COLOR: string }; +export type EvolutionBot = { ENABLED: boolean }; export type Typebot = { ENABLED: boolean; API_VERSION: string; SEND_MEDIA_BASE64: boolean }; export type Chatwoot = { ENABLED: boolean; @@ -411,6 +412,7 @@ export interface Env { PUSHER: Pusher; CONFIG_SESSION_PHONE: ConfigSessionPhone; QRCODE: QrCode; + EVOLUTIONBOT: EvolutionBot; TYPEBOT: Typebot; CHATWOOT: Chatwoot; OPENAI: Openai; @@ -804,6 +806,9 @@ export class ConfigService { LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30, COLOR: process.env.QRCODE_COLOR || '#198754', }, + EVOLUTIONBOT: { + ENABLED: process.env?.EVOLUTIONBOT_ENABLED === 'true', + }, TYPEBOT: { ENABLED: process.env?.TYPEBOT_ENABLED === 'true', API_VERSION: process.env?.TYPEBOT_API_VERSION || 'old', From 214a260485b2ba2ae4923e46c98b1c33199a179e Mon Sep 17 00:00:00 2001 From: Iago Cotta Date: Fri, 22 May 2026 16:00:16 -0300 Subject: [PATCH 2/2] default true for EvolutionBot if value undefined or null --- .../chatbot/evolutionBot/controllers/evolutionBot.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts b/src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts index 6100c6f712..0864b6133c 100644 --- a/src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts +++ b/src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts @@ -24,7 +24,7 @@ export class EvolutionBotController extends BaseChatbotController('EVOLUTIONBOT').ENABLED; + integrationEnabled = configService.get('EVOLUTIONBOT').ENABLED ?? true; botRepository: any; settingsRepository: any; sessionRepository: any;