@@ -48,7 +48,7 @@ import { chatwootImport } from '@api/integrations/chatbot/chatwoot/utils/chatwoo
4848import * as s3Service from '@api/integrations/storage/s3/libs/minio.server' ;
4949import { ProviderFiles } from '@api/provider/sessions' ;
5050import { PrismaRepository } from '@api/repository/repository.service' ;
51- import { waMonitor } from '@api/server.module' ;
51+ import { chatbotController , waMonitor } from '@api/server.module' ;
5252import { CacheService } from '@api/services/cache.service' ;
5353import { ChannelStartupService } from '@api/services/channel.service' ;
5454import { Events , MessageSubtype , TypeMediaMessage , wa } from '@api/types/wa.types' ;
@@ -1223,39 +1223,12 @@ export class BaileysStartupService extends ChannelStartupService {
12231223
12241224 this . sendDataWebhook ( Events . MESSAGES_UPSERT , messageRaw ) ;
12251225
1226- if ( this . configService . get < Typebot > ( 'TYPEBOT' ) . ENABLED ) {
1227- if ( type === 'notify' ) {
1228- if ( messageRaw . messageType !== 'reactionMessage' )
1229- await this . typebotService . sendTypebot (
1230- { instanceName : this . instance . name , instanceId : this . instanceId } ,
1231- messageRaw . key . remoteJid ,
1232- messageRaw ,
1233- ) ;
1234- }
1235- }
1236-
1237- if ( this . configService . get < Openai > ( 'OPENAI' ) . ENABLED ) {
1238- if ( type === 'notify' ) {
1239- if ( messageRaw . messageType !== 'reactionMessage' )
1240- await this . openaiService . sendOpenai (
1241- { instanceName : this . instance . name , instanceId : this . instanceId } ,
1242- messageRaw . key . remoteJid ,
1243- messageRaw . pushName ,
1244- messageRaw ,
1245- ) ;
1246- }
1247- }
1248-
1249- if ( this . configService . get < Dify > ( 'DIFY' ) . ENABLED ) {
1250- if ( type === 'notify' ) {
1251- if ( messageRaw . messageType !== 'reactionMessage' )
1252- await this . difyService . sendDify (
1253- { instanceName : this . instance . name , instanceId : this . instanceId } ,
1254- messageRaw . key . remoteJid ,
1255- messageRaw ,
1256- ) ;
1257- }
1258- }
1226+ await chatbotController . emit ( {
1227+ instance : { instanceName : this . instance . name , instanceId : this . instanceId } ,
1228+ remoteJid : messageRaw . key . remoteJid ,
1229+ msg : messageRaw ,
1230+ pushName : messageRaw . pushName ,
1231+ } ) ;
12591232
12601233 const contact = await this . prismaRepository . contact . findFirst ( {
12611234 where : { remoteJid : received . key . remoteJid , instanceId : this . instanceId } ,
0 commit comments