1- import { WASocket } from '@whiskeysockets/baileys' ;
21import axios from 'axios' ;
2+ import { WASocket } from 'baileys' ;
33import { execSync } from 'child_process' ;
44import { isURL } from 'class-validator' ;
55import EventEmitter2 from 'eventemitter2' ;
@@ -38,17 +38,17 @@ import { waMonitor } from '../server.module';
3838import { Events , wa } from '../types/wa.types' ;
3939import { CacheService } from './cache.service' ;
4040
41- export class WAStartupService {
41+ export class ChannelStartupService {
4242 constructor (
4343 public readonly configService : ConfigService ,
4444 public readonly eventEmitter : EventEmitter2 ,
4545 public readonly repository : RepositoryBroker ,
4646 public readonly chatwootCache : CacheService ,
4747 ) {
48- this . logger . verbose ( 'WAStartupService initialized' ) ;
48+ this . logger . verbose ( 'ChannelStartupService initialized' ) ;
4949 }
5050
51- public readonly logger = new Logger ( WAStartupService . name ) ;
51+ public readonly logger = new Logger ( ChannelStartupService . name ) ;
5252
5353 public client : WASocket ;
5454 public readonly instance : wa . Instance = { } ;
@@ -742,7 +742,7 @@ export class WAStartupService {
742742
743743 if ( this . configService . get < Log > ( 'LOG' ) . LEVEL . includes ( 'WEBHOOKS' ) ) {
744744 const logData = {
745- local : WAStartupService . name + '.sendData-RabbitMQ' ,
745+ local : ChannelStartupService . name + '.sendData-RabbitMQ' ,
746746 event,
747747 instance : this . instance . name ,
748748 data,
@@ -798,7 +798,7 @@ export class WAStartupService {
798798 sqs . sendMessage ( params , ( err , data ) => {
799799 if ( err ) {
800800 this . logger . error ( {
801- local : WAStartupService . name + '.sendData-SQS' ,
801+ local : ChannelStartupService . name + '.sendData-SQS' ,
802802 message : err ?. message ,
803803 hostName : err ?. hostname ,
804804 code : err ?. code ,
@@ -810,7 +810,7 @@ export class WAStartupService {
810810 } else {
811811 if ( this . configService . get < Log > ( 'LOG' ) . LEVEL . includes ( 'WEBHOOKS' ) ) {
812812 const logData = {
813- local : WAStartupService . name + '.sendData-SQS' ,
813+ local : ChannelStartupService . name + '.sendData-SQS' ,
814814 event,
815815 instance : this . instance . name ,
816816 data,
@@ -854,7 +854,7 @@ export class WAStartupService {
854854
855855 if ( this . configService . get < Log > ( 'LOG' ) . LEVEL . includes ( 'WEBHOOKS' ) ) {
856856 const logData = {
857- local : WAStartupService . name + '.sendData-WebsocketGlobal' ,
857+ local : ChannelStartupService . name + '.sendData-WebsocketGlobal' ,
858858 event,
859859 instance : this . instance . name ,
860860 data,
@@ -884,7 +884,7 @@ export class WAStartupService {
884884
885885 if ( this . configService . get < Log > ( 'LOG' ) . LEVEL . includes ( 'WEBHOOKS' ) ) {
886886 const logData = {
887- local : WAStartupService . name + '.sendData-Websocket' ,
887+ local : ChannelStartupService . name + '.sendData-Websocket' ,
888888 event,
889889 instance : this . instance . name ,
890890 data,
@@ -918,7 +918,7 @@ export class WAStartupService {
918918
919919 if ( this . configService . get < Log > ( 'LOG' ) . LEVEL . includes ( 'WEBHOOKS' ) ) {
920920 const logData = {
921- local : WAStartupService . name + '.sendDataWebhook-local' ,
921+ local : ChannelStartupService . name + '.sendDataWebhook-local' ,
922922 url : baseURL ,
923923 event,
924924 instance : this . instance . name ,
@@ -958,7 +958,7 @@ export class WAStartupService {
958958 }
959959 } catch ( error ) {
960960 this . logger . error ( {
961- local : WAStartupService . name + '.sendDataWebhook-local' ,
961+ local : ChannelStartupService . name + '.sendDataWebhook-local' ,
962962 message : error ?. message ,
963963 hostName : error ?. hostname ,
964964 syscall : error ?. syscall ,
@@ -990,7 +990,7 @@ export class WAStartupService {
990990
991991 if ( this . configService . get < Log > ( 'LOG' ) . LEVEL . includes ( 'WEBHOOKS' ) ) {
992992 const logData = {
993- local : WAStartupService . name + '.sendDataWebhook-global' ,
993+ local : ChannelStartupService . name + '.sendDataWebhook-global' ,
994994 url : globalURL ,
995995 event,
996996 instance : this . instance . name ,
@@ -1029,7 +1029,7 @@ export class WAStartupService {
10291029 }
10301030 } catch ( error ) {
10311031 this . logger . error ( {
1032- local : WAStartupService . name + '.sendDataWebhook-global' ,
1032+ local : ChannelStartupService . name + '.sendDataWebhook-global' ,
10331033 message : error ?. message ,
10341034 hostName : error ?. hostname ,
10351035 syscall : error ?. syscall ,
0 commit comments