From 6cea02252ee4f106f546f2162f11b0d16b7c38ce Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 3 Jul 2024 13:22:09 -0300 Subject: [PATCH] chore: Clear logs in Whatsapp Baileys Service This commit removes console logs from the Whatsapp Baileys Service in the `whatsapp.baileys.service.ts` file. The logs that were removed were not necessary for the functionality of the service and were only used for debugging purposes. By removing them, we improve the performance and readability of the code. Modified files: - src/api/services/channels/whatsapp.baileys.service.ts --- .../channels/whatsapp.baileys.service.ts | 55 ------------------- 1 file changed, 55 deletions(-) diff --git a/src/api/services/channels/whatsapp.baileys.service.ts b/src/api/services/channels/whatsapp.baileys.service.ts index 3383b2a6..638244c0 100644 --- a/src/api/services/channels/whatsapp.baileys.service.ts +++ b/src/api/services/channels/whatsapp.baileys.service.ts @@ -874,8 +874,6 @@ export class BaileysStartupService extends ChannelStartupService { this.sendDataWebhook(Events.CHATS_SET, chatsRaw); - // console.log('chatsRaw', chatsRaw); - const chatsSaved = await this.prismaRepository.chat.createMany({ data: chatsRaw, skipDuplicates: true, @@ -936,8 +934,6 @@ export class BaileysStartupService extends ChannelStartupService { }); } - // console.log('messagesRaw', messagesRaw); - this.sendDataWebhook(Events.MESSAGES_SET, [...messagesRaw]); const messagesSaved = await this.prismaRepository.message.createMany({ @@ -1850,56 +1846,6 @@ export class BaileysStartupService extends ChannelStartupService { return jid; }); } - // console.log('group.participants', group.participants.length); - - // const batchSize = 200; - - // const batches = Array.from({ length: Math.ceil(group.participants.length / batchSize) }, (_, i) => - // group.participants.slice(i * batchSize, i * batchSize + batchSize), - // ); - - // console.log('batches', batches.length); - - // const firstBatch = batches.shift(); - - // let firstMessage: WAMessage; - // let msgId: string | null = null; - - // if (firstBatch) { - // firstMessage = await this.sendMessage( - // sender, - // message, - // mentions, - // linkPreview, - // quoted, - // null, - // group?.ephemeralDuration, - // firstBatch, - // ); - - // msgId = firstMessage.key.id; - // } - - // if (batches.length === 0) messageSent = firstMessage; - - // await Promise.allSettled( - // batches.map(async (batch: GroupParticipant[]) => { - // const messageSent = await this.sendMessage( - // sender, - // message, - // mentions, - // linkPreview, - // quoted, - // msgId, - // group?.ephemeralDuration, - // batch, - // ); - - // return messageSent; - // }), - // ); - - // messageSent = firstMessage; messageSent = await this.sendMessage( sender, @@ -3075,7 +3021,6 @@ export class BaileysStartupService extends ChannelStartupService { try { const msg: any = await this.getMessage(data.key, true); - console.log('msg', msg); if (msg?.messageType === 'conversation' || msg?.messageType === 'extendedTextMessage') { return { text: data.text,