Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ QRCODE_COLOR=#198754
# INTEGRAÇÕES
# ===========================================

# EvolutionBot
EVOLUTIONBOT_ENABLED=false

# Typebot
TYPEBOT_ENABLED=false
TYPEBOT_API_VERSION=old
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -23,7 +24,7 @@ export class EvolutionBotController extends BaseChatbotController<EvolutionBot,
public readonly logger = new Logger('EvolutionBotController');
protected readonly integrationName = 'EvolutionBot';

integrationEnabled = true; // Set to true by default or use config value if available
integrationEnabled = configService.get<EvolutionBotConfig>('EVOLUTIONBOT').ENABLED;
botRepository: any;
settingsRepository: any;
sessionRepository: any;
Expand Down
5 changes: 5 additions & 0 deletions src/config/env.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -411,6 +412,7 @@ export interface Env {
PUSHER: Pusher;
CONFIG_SESSION_PHONE: ConfigSessionPhone;
QRCODE: QrCode;
EVOLUTIONBOT: EvolutionBot;
TYPEBOT: Typebot;
CHATWOOT: Chatwoot;
OPENAI: Openai;
Expand Down Expand Up @@ -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',
Expand Down