Fix: shouldSyncHistoryMessage debe retornar true cuando no hay timestamp
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m9s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m9s
El check inicial de Baileys pasa un objeto sin messageTimestamp. Cuando era undefined, la comparación retornaba false y Baileys deshabilitaba la sincronización de historial completamente.
This commit is contained in:
@@ -159,9 +159,11 @@ class BaileysManager extends EventEmitter {
|
||||
syncFullHistory: true,
|
||||
markOnlineOnConnect: false,
|
||||
// Sync history messages from the last 30 days
|
||||
// IMPORTANTE: Si no hay messageTimestamp, retornar true para permitir el check inicial de Baileys
|
||||
shouldSyncHistoryMessage: (msg) => {
|
||||
if (!msg.messageTimestamp) return true
|
||||
const thirtyDaysAgo = Date.now() / 1000 - (30 * 24 * 60 * 60)
|
||||
return msg.messageTimestamp! >= thirtyDaysAgo
|
||||
return msg.messageTimestamp >= thirtyDaysAgo
|
||||
},
|
||||
// getMessage for resending/decrypting messages
|
||||
getMessage: async (key) => {
|
||||
|
||||
Reference in New Issue
Block a user