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.
sock.chatModify(modification, jid) envia atualizações de app-state cifradas.
Se você enviar um chatModify malformado, o WhatsApp pode te deslogar de todos os aparelhos. Sempre passe o lastMessages correto.
Arquivar uma conversa
const lastMsgInChat = await getLastMessageInChat(jid)
await sock.chatModify({ archive: true, lastMessages: [lastMsgInChat] }, jid)
Silenciar / dessilenciar
| Duração | Milissegundos |
|---|
| Dessilenciar | null |
| 8 horas | 28800000 |
| 7 dias | 604800000 |
await sock.chatModify({ mute: 8 * 60 * 60 * 1000 }, jid)
await sock.chatModify({ mute: null }, jid)
Marcar como lida ou não lida
const lastMsgInChat = await getLastMessageInChat(jid)
await sock.chatModify({ markRead: false, lastMessages: [lastMsgInChat] }, jid)
Deletar mensagem só para você
await sock.chatModify(
{
clear: {
messages: [
{
id: 'ATWYHDNNWU81732J',
fromMe: true,
timestamp: '1654823909'
}
]
}
},
jid
)
Deletar uma conversa
const lastMsgInChat = await getLastMessageInChat(jid)
await sock.chatModify({
delete: true,
lastMessages: [
{
key: lastMsgInChat.key,
messageTimestamp: lastMsgInChat.messageTimestamp
}
]
},
jid
)
Fixar / desfixar conversa
await sock.chatModify({
pin: true
},
jid
)
Favoritar / desfavoritar mensagem
await sock.chatModify({
star: {
messages: [
{
id: 'messageID',
fromMe: true
}
],
star: true
}
},
jid
)
Consultas de usuário
Verificar se um JID existe no WhatsApp
const [result] = await sock.onWhatsApp(jid)
if (result.exists) console.log (`${jid} exists on WhatsApp, as jid: ${result.jid}`)
Consultar histórico
const msg = await getOldestMessageInChat(jid)
await sock.fetchMessageHistory(
50,
msg.key,
msg.messageTimestamp
)
Mensagens chegam pelo evento messaging-history.set, não retornadas diretamente.
Buscar texto de status
const status = await sock.fetchStatus(jid)
console.log('status: ' + status)
Buscar foto de perfil
const ppUrl = await sock.profilePictureUrl(jid)
const ppUrl = await sock.profilePictureUrl(jid, 'image') // alta resolução
Buscar perfil business
const profile = await sock.getBusinessProfile(jid)
console.log('business description: ' + profile.description + ', category: ' + profile.category)
Atualizar seu perfil
await sock.updateProfileStatus('Hello World!')
await sock.updateProfileName('My name')
await sock.updateProfilePicture(jid, { url: './new-profile-picture.jpeg' })
await sock.removeProfilePicture(jid)