Skip to content

Commit

Permalink
chore: Clear logs in Whatsapp Baileys Service
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dgcode-tec committed Jul 3, 2024
1 parent 8e72983 commit 6cea022
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions src/api/services/channels/whatsapp.baileys.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6cea022

Please sign in to comment.