Pular para o conteúdo principal

Documentation Index

Fetch the complete documentation index at: https://zapo.to/llms.txt

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

Presença própria

Transmita se a conta está online com client.presence.send:
await client.presence.send('available')   // aparece online
await client.presence.send('unavailable') // aparece offline
A presença anunciada logo após a conexão é controlada pela opção markOnlineOnConnect.

Indicadores de digitação (chat-state)

O sendChatstate envia uma dica por chat, como digitando ou gravando:
// "digitando…"
await client.presence.sendChatstate(jid, { state: 'composing' })

// "gravando áudio…"
await client.presence.sendChatstate(jid, { state: 'recording' })

// limpa o indicador
await client.presence.sendChatstate(jid, { state: 'paused' })
Um padrão comum é exibir o estado digitando por um breve momento antes de responder:
await client.presence.sendChatstate(jid, { state: 'composing' })
await new Promise((r) => setTimeout(r, 1200))
await client.message.send(jid, 'Done thinking!')
await client.presence.sendChatstate(jid, { state: 'paused' })

Assinando um contato

Para receber a presença e o chat-state de um contato, assine-o:
await client.presence.subscribe(jid)

client.on('presence', (event) => {
  console.log(event.type, event.lastSeen)
})

client.on('chatstate', (event) => {
  console.log(event.state, 'from', event.participantJid)
})
As assinaturas são por JID e vivem apenas durante a conexão atual. Após uma reconexão, você precisa assinar novamente para continuar recebendo atualizações.

Transmissões de status

Publique um status (a funcionalidade de “stories”) com client.status (WaStatusCoordinator). O conteúdo é a mesma union de conteúdo de uma mensagem normal; você fornece a lista de destinatários:
const result = await client.status.send({
  content: 'Hello from my status!',
  recipients: ['5511999999999@s.whatsapp.net', '5511888888888@s.whatsapp.net']
})
Mídia também funciona:
await client.status.send({
  content: { type: 'image', media: './story.jpg', mimetype: 'image/jpeg' },
  recipients
})

Privacidade e silenciamento de status

// Quem pode ver o seu status
await client.status.setPrivacy({ /* WaSetStatusPrivacyInput */ })

// Silenciar o status de um contato
await client.status.setUserMuted(jid, true)

// Revogar um status que você publicou
await client.status.revokeStatus({ messageId, recipients })
Last modified on May 27, 2026