feat: update dependencies and improve channel services

Updated dependencies in package.json to ensure compatibility and performance. Enhanced functionality in channel.service.ts and whatsapp.baileys.service.ts for better service handling and reliability. This update aims to improve overall system stability and performance.
This commit is contained in:
Davidson Gomes 2024-06-18 11:28:10 -03:00
parent 4349959daa
commit 4120318ec4
3 changed files with 5 additions and 6 deletions

View File

@ -75,8 +75,6 @@
"join": "^3.0.0", "join": "^3.0.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"jsonschema": "^1.4.1", "jsonschema": "^1.4.1",
"jsonwebtoken": "^9.0.2",
"libphonenumber-js": "^1.10.39",
"link-preview-js": "^3.0.4", "link-preview-js": "^3.0.4",
"node-cache": "^5.1.2", "node-cache": "^5.1.2",
"node-mime-types": "^1.1.0", "node-mime-types": "^1.1.0",
@ -100,7 +98,6 @@
"@types/cors": "^2.8.13", "@types/cors": "^2.8.13",
"@types/express": "^4.17.17", "@types/express": "^4.17.17",
"@types/js-yaml": "^4.0.5", "@types/js-yaml": "^4.0.5",
"@types/jsonwebtoken": "^8.5.9",
"@types/mime-types": "^2.1.1", "@types/mime-types": "^2.1.1",
"@types/node": "^18.15.11", "@types/node": "^18.15.11",
"@types/node-windows": "^0.1.2", "@types/node-windows": "^0.1.2",

View File

@ -591,7 +591,9 @@ export class ChannelStartupService {
autoDelete: false, autoDelete: false,
}); });
const queueName = `${this.instanceName}.${event}`; const eventName = event.replace(/_/g, '.').toLowerCase();
const queueName = `${this.instanceName}.${eventName}`;
await amqp.assertQueue(queueName, { await amqp.assertQueue(queueName, {
durable: true, durable: true,
@ -601,7 +603,7 @@ export class ChannelStartupService {
}, },
}); });
await amqp.bindQueue(queueName, exchangeName, event); await amqp.bindQueue(queueName, exchangeName, eventName);
const message = { const message = {
event, event,

View File

@ -1514,7 +1514,7 @@ export class BaileysStartupService extends ChannelStartupService {
if (events['presence.update']) { if (events['presence.update']) {
const payload = events['presence.update']; const payload = events['presence.update'];
if (settings.groupsIgnore && payload.id.includes('@g.us')) { if (settings?.groupsIgnore && payload.id.includes('@g.us')) {
return; return;
} }
this.sendDataWebhook(Events.PRESENCE_UPDATE, payload); this.sendDataWebhook(Events.PRESENCE_UPDATE, payload);