mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 01:41:24 -06:00
wip
This commit is contained in:
parent
5bc33ac654
commit
d47cc5d5f4
@ -11,7 +11,7 @@ let io: SocketIO;
|
||||
const cors = configService.get<Cors>('CORS').ORIGIN;
|
||||
|
||||
export const initIO = (httpServer: Server) => {
|
||||
if (configService.get<Websocket>('WEBSOCKET').ENABLED) {
|
||||
if (configService.get<Websocket>('WEBSOCKET')?.ENABLED) {
|
||||
io = new SocketIO(httpServer, {
|
||||
cors: {
|
||||
origin: cors,
|
||||
|
@ -89,7 +89,7 @@ function bootstrap() {
|
||||
|
||||
initIO(server);
|
||||
|
||||
if (configService.get<Rabbitmq>('RABBITMQ').ENABLED) initAMQP();
|
||||
if (configService.get<Rabbitmq>('RABBITMQ')?.ENABLED) initAMQP();
|
||||
|
||||
onUnexpectedError();
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ export class WAStartupService {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.configService.get<Websocket>('WEBSOCKET').ENABLED && this.localWebsocket.enabled) {
|
||||
if (this.configService.get<Websocket>('WEBSOCKET')?.ENABLED && this.localWebsocket.enabled) {
|
||||
this.logger.verbose('Sending data to websocket on channel: ' + this.instance.name);
|
||||
if (Array.isArray(websocketLocal) && websocketLocal.includes(we)) {
|
||||
this.logger.verbose('Sending data to websocket on event: ' + event);
|
||||
@ -1844,8 +1844,7 @@ export class WAStartupService {
|
||||
private async sendMessageWithTyping<T = proto.IMessage>(number: string, message: T, options?: Options) {
|
||||
this.logger.verbose('Sending message with typing');
|
||||
|
||||
const numberWA = await this.whatsappNumber({ numbers: [number] });
|
||||
const isWA = numberWA[0];
|
||||
const isWA = (await this.whatsappNumber({ numbers: [number] }))?.shift();
|
||||
|
||||
if (!isWA.exists && !isJidGroup(isWA.jid) && !isWA.jid.includes('@broadcast')) {
|
||||
throw new BadRequestException(isWA);
|
||||
@ -1911,7 +1910,6 @@ export class WAStartupService {
|
||||
const jid = this.createJid(mention);
|
||||
if (isJidGroup(jid)) {
|
||||
return null;
|
||||
// throw new BadRequestException('Mentions must be a number');
|
||||
}
|
||||
return jid;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user