Skip to content

Commit d47cc5d

Browse files
authored
wip
1 parent 5bc33ac commit d47cc5d

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/libs/socket.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let io: SocketIO;
1111
const cors = configService.get<Cors>('CORS').ORIGIN;
1212

1313
export 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,

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/whatsapp/services/whatsapp.service.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)