Sending Messages
Everything goes through one door: sock.sendMessage(jid, content, options?). Private JID: 12125550123@s.whatsapp.net ยท group: 120363xxx@g.us ยท newsletter: 120363xxx@newsletter.
Text, images, documents
await sock.sendMessage(jid, { text: 'Hello!' })
await sock.sendMessage(jid, {
image: { url: 'https://example.com/image.jpg' },
caption: 'An image caption'
})
await sock.sendMessage(jid, {
document: { url: 'https://example.com/file.pdf' },
mimetype: 'application/pdf',
fileName: 'file.pdf'
})
// Reply / quote a message:
await sock.sendMessage(jid, { text: 'On it!' }, { quoted: m })
// Reaction:
await sock.sendMessage(jid, { react: { text: '๐ค', key: m.key } })
StickerPack โ AunuBaileys exclusive (v1.0.2+)
Send a complete sticker pack โ a cover plus up to 60 stickers โ in a single call, using the stickerPack content form:
await sock.sendMessage(jid, {
stickerPack: {
name: 'AunuCore Pack',
publisher: 'AunuCore',
cover: { url: 'https://example.com/cover.webp' },
stickers: [
{ data: { url: 'https://example.com/s1.webp' }, emojis: ['๐ค', '๐ฅ'] },
{ data: { url: 'https://example.com/s2.webp' }, emojis: ['๐'] }
]
}
})
A flat form is also accepted: { stickers: [...], cover, name, publisher, description } directly at the top level of the content.
Photo / video albums (v1.0.2+)
await sock.sendMessage(jid, {
album: [
{ image: { url: 'https://example.com/1.jpg' }, caption: 'First' },
{ image: { url: 'https://example.com/2.jpg' } },
{ video: { url: 'https://example.com/3.mp4' } }
]
})
AI label (v1.0.2+)
Mark bot replies with the AI label โ private chats only:
await sock.sendMessage(jid, { text: 'An AI-generated answer', ai: true })
Polls / quizzes
await sock.sendMessage(jid, {
poll: {
name: 'Next feature?',
values: ['Music', 'Games', 'Tools'],
selectableCount: 1
}
})
Since v1.0.3 the codebase also carries quiz poll types for newsletters, poll result snapshots, and poll updates.
Newsletters / channels
Media sent to channels uses the dedicated newsletter upload paths (fixed in v1.0.2 โ previously the root cause of failed channel media). Normalize a channel JID with the helper:
const handler = sock.aunuHandler // attached to every socket (v1.0.3+)
const channelJid = handler.newsletterId(jid)