File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ let io: SocketIO;
1111const cors = configService . get < Cors > ( 'CORS' ) . ORIGIN ;
1212
1313export const initIO = ( httpServer : Server ) => {
14- if ( configService . get < Websocket > ( 'WEBSOCKET' ) . ENABLED ) {
14+ if ( configService . get < Websocket > ( 'WEBSOCKET' ) ? .ENABLED ) {
1515 io = new SocketIO ( httpServer , {
1616 cors : {
1717 origin : cors ,
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ function bootstrap() {
8989
9090 initIO ( server ) ;
9191
92- if ( configService . get < Rabbitmq > ( 'RABBITMQ' ) . ENABLED ) initAMQP ( ) ;
92+ if ( configService . get < Rabbitmq > ( 'RABBITMQ' ) ? .ENABLED ) initAMQP ( ) ;
9393
9494 onUnexpectedError ( ) ;
9595}
Original file line number Diff line number Diff line change @@ -637,7 +637,7 @@ export class WAStartupService {
637637 }
638638 }
639639
640- if ( this . configService . get < Websocket > ( 'WEBSOCKET' ) . ENABLED && this . localWebsocket . enabled ) {
640+ if ( this . configService . get < Websocket > ( 'WEBSOCKET' ) ? .ENABLED && this . localWebsocket . enabled ) {
641641 this . logger . verbose ( 'Sending data to websocket on channel: ' + this . instance . name ) ;
642642 if ( Array . isArray ( websocketLocal ) && websocketLocal . includes ( we ) ) {
643643 this . logger . verbose ( 'Sending data to websocket on event: ' + event ) ;
@@ -1844,8 +1844,7 @@ export class WAStartupService {
18441844 private async sendMessageWithTyping < T = proto . IMessage > ( number : string , message : T , options ?: Options ) {
18451845 this . logger . verbose ( 'Sending message with typing' ) ;
18461846
1847- const numberWA = await this . whatsappNumber ( { numbers : [ number ] } ) ;
1848- const isWA = numberWA [ 0 ] ;
1847+ const isWA = ( await this . whatsappNumber ( { numbers : [ number ] } ) ) ?. shift ( ) ;
18491848
18501849 if ( ! isWA . exists && ! isJidGroup ( isWA . jid ) && ! isWA . jid . includes ( '@broadcast' ) ) {
18511850 throw new BadRequestException ( isWA ) ;
@@ -1911,7 +1910,6 @@ export class WAStartupService {
19111910 const jid = this . createJid ( mention ) ;
19121911 if ( isJidGroup ( jid ) ) {
19131912 return null ;
1914- // throw new BadRequestException('Mentions must be a number');
19151913 }
19161914 return jid ;
19171915 } ) ;
You can’t perform that action at this time.
0 commit comments