example: cleanup

This commit is contained in:
Rajeh Taher
2026-01-22 14:34:54 +02:00
parent 0826895c6b
commit bfde86bce7
2 changed files with 3 additions and 6 deletions
+1 -4
View File
@@ -1,10 +1,7 @@
import { Boom } from '@hapi/boom'
import NodeCache from '@cacheable/node-cache'
import readline from 'readline'
import makeWASocket, { AnyMessageContent, BinaryInfo, CacheStore, DEFAULT_CONNECTION_CONFIG, delay, DisconnectReason, downloadAndProcessHistorySyncNotification, encodeWAM, fetchLatestBaileysVersion, generateMessageIDV2, getAggregateVotesInPollMessage, getHistoryMsg, isJidNewsletter, jidDecode, makeCacheableSignalKeyStore, normalizeMessageContent, PatchedMessageWithRecipientJID, proto, useMultiFileAuthState, WAMessageContent, WAMessageKey } from '../src'
//import MAIN_LOGGER from '../src/Utils/logger'
import open from 'open'
import fs from 'fs'
import makeWASocket, { CacheStore, DEFAULT_CONNECTION_CONFIG, DisconnectReason, fetchLatestBaileysVersion, generateMessageIDV2, getAggregateVotesInPollMessage, isJidNewsletter, makeCacheableSignalKeyStore, proto, useMultiFileAuthState, WAMessageContent, WAMessageKey } from '../src'
import P from 'pino'
const logger = P({
+2 -2
View File
@@ -4,9 +4,9 @@ import { proto } from '../../WAProto/index.js'
import type { Chat, Contact, LIDMapping, WAMessage } from '../Types'
import { WAMessageStubType } from '../Types'
import { toNumber } from './generics'
import type { ILogger } from './logger.js'
import { normalizeMessageContent } from './messages'
import { downloadContentFromMessage } from './messages-media'
import type { ILogger } from './logger.js'
const inflatePromise = promisify(inflate)
@@ -32,7 +32,7 @@ export const processHistoryMessage = (item: proto.IHistorySync, logger?: ILogger
const chats: Chat[] = []
const lidPnMappings: LIDMapping[] = []
logger?.trace({ progress: item.progress }, 'processing history of type '+ item.syncType?.toString())
logger?.trace({ progress: item.progress }, 'processing history of type ' + item.syncType?.toString())
// Extract LID-PN mappings for all sync types
for (const m of item.phoneNumberToLidMappings || []) {