messaging-history.set.
Tratando o payload
Pedir histórico completo
Sincronização completa aumenta tempo de inicialização e memória em contas grandes.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Receba conversas e contatos anteriores, e puxe mais histórico sob demanda.
messaging-history.set.
sock.ev.on('messaging-history.set', ({
chats: newChats,
contacts: newContacts,
messages: newMessages,
syncType,
}) => {
// Persista no seu store
})
import makeWASocket, { Browsers } from '@whiskeysockets/baileys'
const sock = makeWASocket({
browser: Browsers.macOS('Desktop'),
syncFullHistory: true,
})
const sock = makeWASocket({
shouldSyncHistoryMessage: () => false,
})
await sock.fetchMessageHistory(/* count, oldestMsgKey, oldestMsgTimestamp */)