Feature: habilitar History Sync en Baileys
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 52s

- syncFullHistory: true
- shouldSyncHistoryMessage: sincroniza mensajes de los ultimos 30 dias
- Permite cargar chats existentes de WhatsApp
This commit is contained in:
2025-12-02 20:04:33 -06:00
parent fd67a955da
commit 1b5317845d

View File

@@ -154,8 +154,13 @@ class BaileysManager extends EventEmitter {
browser: Browsers.ubuntu('WhatsApp Nucleo'),
logger: pino({ level: 'debug' }),
generateHighQualityLinkPreview: true,
syncFullHistory: false,
syncFullHistory: true,
markOnlineOnConnect: false,
// Sync history messages from the last 30 days
shouldSyncHistoryMessage: (msg) => {
const thirtyDaysAgo = Date.now() / 1000 - (30 * 24 * 60 * 60)
return msg.messageTimestamp! >= thirtyDaysAgo
},
// getMessage for resending/decrypting messages
getMessage: async (key) => {
try {