mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 04:02:54 -06:00
refactor: chatbot integration
This commit is contained in:
parent
9209c9992d
commit
e7d971867b
@ -2010,11 +2010,13 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
);
|
||||
}
|
||||
|
||||
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED && this.localChatwoot.enabled && isIntegration)
|
||||
await chatbotController.emit({
|
||||
instance: { instanceName: this.instance.name, instanceId: this.instanceId },
|
||||
remoteJid: messageRaw.key.remoteJid,
|
||||
msg: messageRaw,
|
||||
pushName: messageRaw.pushName,
|
||||
isIntegration,
|
||||
});
|
||||
|
||||
if (this.configService.get<Database>('DATABASE').SAVE_DATA.NEW_MESSAGE)
|
||||
|
@ -923,6 +923,7 @@ export class BusinessStartupService extends ChannelStartupService {
|
||||
);
|
||||
}
|
||||
|
||||
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED && this.localChatwoot.enabled && isIntegration)
|
||||
await chatbotController.emit({
|
||||
instance: { instanceName: this.instance.name, instanceId: this.instanceId },
|
||||
remoteJid: messageRaw.key.remoteJid,
|
||||
|
@ -68,17 +68,20 @@ export class ChatbotController {
|
||||
remoteJid,
|
||||
msg,
|
||||
pushName,
|
||||
isIntegration = false,
|
||||
}: {
|
||||
instance: InstanceDto;
|
||||
remoteJid: string;
|
||||
msg: any;
|
||||
pushName?: string;
|
||||
isIntegration?: boolean;
|
||||
}): Promise<void> {
|
||||
const emitData = {
|
||||
instance,
|
||||
remoteJid,
|
||||
msg,
|
||||
pushName,
|
||||
isIntegration,
|
||||
};
|
||||
// typebot
|
||||
await typebotController.emit(emitData);
|
||||
|
Loading…
Reference in New Issue
Block a user