added typebot integration activation

This commit is contained in:
Davidson Gomes
2024-06-06 16:44:18 -03:00
parent 1be9c7f95d
commit 161814a9e5
5 changed files with 52 additions and 25 deletions

View File

@@ -4,7 +4,7 @@ import { isURL } from 'class-validator';
import EventEmitter2 from 'eventemitter2';
import { v4 } from 'uuid';
import { Auth, Chatwoot, ConfigService, HttpServer, WaBusiness } from '../../config/env.config';
import { Auth, Chatwoot, ConfigService, HttpServer, Typebot, WaBusiness } from '../../config/env.config';
import { Logger } from '../../config/logger.config';
import { BadRequestException, InternalServerErrorException, UnauthorizedException } from '../../exceptions';
import { InstanceDto, SetPresenceDto } from '../dto/instance.dto';
@@ -381,7 +381,7 @@ export class InstanceController {
});
}
if (typebotUrl) {
if (this.configService.get<Typebot>('TYPEBOT').ENABLED && typebotUrl) {
try {
if (!isURL(typebotUrl, { require_tld: false })) {
throw new BadRequestException('Invalid "url" property in typebotUrl');