diff --git a/.env.example b/.env.example index c82051095f..f33f7195bf 100644 --- a/.env.example +++ b/.env.example @@ -333,6 +333,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 60d0ef115a..4558e3e3ad 100644 --- a/env.example +++ b/env.example @@ -214,6 +214,9 @@ QRCODE_COLOR=#198754 # INTEGRAÇÕES # =========================================== +# EvolutionBot - Environment variables +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..0864b6133c 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 ?? true; botRepository: any; settingsRepository: any; sessionRepository: any; diff --git a/src/config/env.config.ts b/src/config/env.config.ts index 1b17a83b53..17f2a2a705 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -328,6 +328,7 @@ export type Pusher = { ENABLED: boolean; GLOBAL?: GlobalPusher; EVENTS: EventsPu export type ConfigSessionPhone = { CLIENT: string; NAME: string }; export type Baileys = { VERSION?: 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; @@ -427,6 +428,7 @@ export interface Env { CONFIG_SESSION_PHONE: ConfigSessionPhone; BAILEYS: Baileys; QRCODE: QrCode; + EVOLUTIONBOT: EvolutionBot; TYPEBOT: Typebot; CHATWOOT: Chatwoot; OPENAI: Openai; @@ -837,6 +839,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',