diff --git a/src/whatsapp/controllers/instance.controller.ts b/src/whatsapp/controllers/instance.controller.ts index 8480c675..19669320 100644 --- a/src/whatsapp/controllers/instance.controller.ts +++ b/src/whatsapp/controllers/instance.controller.ts @@ -19,7 +19,7 @@ import { TypebotService } from '../services/typebot.service'; import { WebhookService } from '../services/webhook.service'; import { WebsocketService } from '../services/websocket.service'; import { WAStartupService } from '../services/whatsapp.service'; -import { wa } from '../types/wa.types'; +import { Events, wa } from '../types/wa.types'; export class InstanceController { constructor( @@ -87,6 +87,10 @@ export class InstanceController { const instance = new WAStartupService(this.configService, this.eventEmitter, this.repository, this.cache); instance.instanceName = instanceName; + instance.sendDataWebhook(Events.INSTANCE_CREATE, { + instanceName, + }); + this.logger.verbose('instance: ' + instance.instanceName + ' created'); this.waMonitor.waInstances[instance.instanceName] = instance; diff --git a/src/whatsapp/types/wa.types.ts b/src/whatsapp/types/wa.types.ts index 27582001..f6e6da6a 100644 --- a/src/whatsapp/types/wa.types.ts +++ b/src/whatsapp/types/wa.types.ts @@ -3,6 +3,7 @@ import { AuthenticationState, WAConnectionState } from '@whiskeysockets/baileys' export enum Events { APPLICATION_STARTUP = 'application.startup', + INSTANCE_CREATE = 'instance.create', QRCODE_UPDATED = 'qrcode.updated', CONNECTION_UPDATE = 'connection.update', STATUS_INSTANCE = 'status.instance',