mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-23 04:22:02 -06:00
lint changes
This commit is contained in:
parent
855c24f38d
commit
d656727b7a
@ -1,6 +1,4 @@
|
||||
import { WAMonitoringService } from '@api/services/monitor.service';
|
||||
|
||||
import { UnauthorizedException } from '../../exceptions';
|
||||
import { PrismaRepository } from '../repository/repository.service';
|
||||
|
||||
export class HealthController {
|
||||
|
@ -1364,24 +1364,33 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (1/* this.localWebhook.enabled */) {
|
||||
if (1/* isMedia && this.localWebhook.webhookBase64 */) {
|
||||
if (this.localWebhook.enabled) {
|
||||
if (isMedia && this.localWebhook.webhookBase64) {
|
||||
try {
|
||||
let buffer : Buffer = null;
|
||||
console.dir({received}, {depth: null});
|
||||
if ((received.message.stickerMessage && received.message.stickerMessage.url === 'https://web.whatsapp.net')
|
||||
|| (received.message.lottieStickerMessage && received.message.lottieStickerMessage.message.stickerMessage.url)) { /*Fixing broken URLs from sticker messages*/
|
||||
const newUrl = `https://mmg.whatsapp.net${received.message.lottieStickerMessage ? received.message.lottieStickerMessage.message.stickerMessage.directPath : received.message.stickerMessage.directPath }`;
|
||||
let buffer: Buffer = null;
|
||||
console.dir({ received }, { depth: null });
|
||||
if (
|
||||
(received.message.stickerMessage &&
|
||||
received.message.stickerMessage.url === 'https://web.whatsapp.net') ||
|
||||
(received.message.lottieStickerMessage &&
|
||||
received.message.lottieStickerMessage.message.stickerMessage.url)
|
||||
) {
|
||||
/*Fixing broken URLs from sticker messages*/
|
||||
const newUrl = `https://mmg.whatsapp.net${received.message.lottieStickerMessage ? received.message.lottieStickerMessage.message.stickerMessage.directPath : received.message.stickerMessage.directPath}`;
|
||||
|
||||
const stream = await downloadContentFromMessage(
|
||||
{
|
||||
mediaKey: received.message?.stickerMessage?.mediaKey || received.message.lottieStickerMessage?.message?.stickerMessage?.mediaKey,
|
||||
directPath: received.message?.stickerMessage?.directPath || received.message.lottieStickerMessage?.message?.stickerMessage?.directPath,
|
||||
url: newUrl
|
||||
mediaKey:
|
||||
received.message?.stickerMessage?.mediaKey ||
|
||||
received.message.lottieStickerMessage?.message?.stickerMessage?.mediaKey,
|
||||
directPath:
|
||||
received.message?.stickerMessage?.directPath ||
|
||||
received.message.lottieStickerMessage?.message?.stickerMessage?.directPath,
|
||||
url: newUrl,
|
||||
},
|
||||
'sticker',
|
||||
{},
|
||||
)
|
||||
);
|
||||
const chunks = [];
|
||||
for await (const chunk of stream) {
|
||||
chunks.push(chunk);
|
||||
@ -1406,7 +1415,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
}
|
||||
}
|
||||
|
||||
console.dir({webhookMessage: messageRaw}, {depth: null})
|
||||
console.dir({ webhookMessage: messageRaw }, { depth: null });
|
||||
this.logger.log(messageRaw);
|
||||
|
||||
this.sendDataWebhook(Events.MESSAGES_UPSERT, messageRaw);
|
||||
@ -1778,7 +1787,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
}
|
||||
|
||||
if (events['messages.upsert']) {
|
||||
const payload = events['messages.upsert']
|
||||
const payload = events['messages.upsert'];
|
||||
this.messageHandle['messages.upsert'](payload, settings);
|
||||
}
|
||||
|
||||
|
@ -1,17 +1,15 @@
|
||||
import { RequestHandler, Router } from "express";
|
||||
import { RouterBroker } from "../abstract/abstract.router";
|
||||
import { HttpStatus } from "./index.router";
|
||||
import { healthController } from "@api/server.module";
|
||||
import { healthController } from '@api/server.module';
|
||||
|
||||
import { RouterBroker } from '../abstract/abstract.router';
|
||||
import { HttpStatus } from './index.router';
|
||||
|
||||
export class HealthRouter extends RouterBroker {
|
||||
constructor() {
|
||||
super();
|
||||
this.router
|
||||
.get(this.routerPath('healthz', false), async (req, res) => {
|
||||
this.router.get(this.routerPath('healthz', false), async (req, res) => {
|
||||
await healthController.checkHealth();
|
||||
return res.status(HttpStatus.OK).json({msg: 'healthy'});
|
||||
})
|
||||
return res.status(HttpStatus.OK).json({ msg: 'healthy' });
|
||||
});
|
||||
}
|
||||
|
||||
public readonly router: Router = Router();
|
||||
|
@ -15,6 +15,7 @@ import { BusinessRouter } from './business.router';
|
||||
import { CallRouter } from './call.router';
|
||||
import { ChatRouter } from './chat.router';
|
||||
import { GroupRouter } from './group.router';
|
||||
import { HealthRouter } from './health.router';
|
||||
import { InstanceRouter } from './instance.router';
|
||||
import { LabelRouter } from './label.router';
|
||||
import { ProxyRouter } from './proxy.router';
|
||||
@ -22,7 +23,6 @@ import { MessageRouter } from './sendMessage.router';
|
||||
import { SettingsRouter } from './settings.router';
|
||||
import { TemplateRouter } from './template.router';
|
||||
import { ViewsRouter } from './view.router';
|
||||
import { HealthRouter} from './health.router';
|
||||
|
||||
enum HttpStatus {
|
||||
OK = 200,
|
||||
|
@ -7,6 +7,7 @@ import { BusinessController } from './controllers/business.controller';
|
||||
import { CallController } from './controllers/call.controller';
|
||||
import { ChatController } from './controllers/chat.controller';
|
||||
import { GroupController } from './controllers/group.controller';
|
||||
import { HealthController } from './controllers/health.controller';
|
||||
import { InstanceController } from './controllers/instance.controller';
|
||||
import { LabelController } from './controllers/label.controller';
|
||||
import { ProxyController } from './controllers/proxy.controller';
|
||||
@ -40,7 +41,6 @@ import { WAMonitoringService } from './services/monitor.service';
|
||||
import { ProxyService } from './services/proxy.service';
|
||||
import { SettingsService } from './services/settings.service';
|
||||
import { TemplateService } from './services/template.service';
|
||||
import { HealthController } from './controllers/health.controller';
|
||||
|
||||
const logger = new Logger('WA MODULE');
|
||||
|
||||
|
@ -553,7 +553,7 @@ export class ChannelStartupService {
|
||||
}
|
||||
|
||||
// Limpa LottieStickerMessage
|
||||
if(cleanedMessage.message.lottieStickerMessage) {
|
||||
if (cleanedMessage.message.lottieStickerMessage) {
|
||||
cleanedMessage.message.lottieStickerMessage = {};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user