mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-20 12:22:21 -06:00
Simplify events structure and fix minor issues
This commit is contained in:
@@ -2,10 +2,10 @@ import { InstanceDto } from '@api/dto/instance.dto';
|
||||
import { PrismaRepository } from '@api/repository/repository.service';
|
||||
import {
|
||||
difyController,
|
||||
eventManager,
|
||||
genericController,
|
||||
openaiController,
|
||||
typebotController,
|
||||
websocketController,
|
||||
} from '@api/server.module';
|
||||
import { WAMonitoringService } from '@api/services/monitor.service';
|
||||
import { Logger } from '@config/logger.config';
|
||||
@@ -102,12 +102,13 @@ export class ChatbotController {
|
||||
await genericController.emit(emitData);
|
||||
}
|
||||
|
||||
public async setInstance(instanceName: string, data: any): Promise<any> {
|
||||
// chatwoot
|
||||
if (data.websocketEnabled)
|
||||
await websocketController.set(instanceName, {
|
||||
enabled: true,
|
||||
events: data.websocketEvents,
|
||||
public async setInstance(instanceName: string, data: InstanceDto): Promise<any> {
|
||||
if (data.websocket.enabled)
|
||||
await eventManager.websocket.set(instanceName, {
|
||||
websocket: {
|
||||
enabled: true,
|
||||
events: data.websocket.events,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -200,7 +201,7 @@ export class ChatbotController {
|
||||
instance: InstanceDto,
|
||||
session?: IntegrationSession,
|
||||
) {
|
||||
let findBot = null;
|
||||
let findBot: null;
|
||||
|
||||
if (!session) {
|
||||
findBot = await findBotByTrigger(botRepository, settingsRepository, content, instance.instanceId);
|
||||
|
||||
Reference in New Issue
Block a user