Pular para o conteúdo principal

Documentation Index

Fetch the complete documentation index at: https://whiskeysockets-docs-jids-socket-config-ptbr.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Após conectar, o socket baixa e processa seus chats, contatos e mensagens existentes via messaging-history.set.

Tratando o payload

sock.ev.on('messaging-history.set', ({
  chats: newChats,
  contacts: newContacts,
  messages: newMessages,
  syncType,
}) => {
  // Persista no seu store
})

Pedir histórico completo

import makeWASocket, { Browsers } from '@whiskeysockets/baileys'

const sock = makeWASocket({
  browser: Browsers.macOS('Desktop'),
  syncFullHistory: true,
})
Sincronização completa aumenta tempo de inicialização e memória em contas grandes.

Desabilitar sincronização

const sock = makeWASocket({
  shouldSyncHistoryMessage: () => false,
})

Sincronização sob demanda

await sock.fetchMessageHistory(/* count, oldestMsgKey, oldestMsgTimestamp */)