WABotJS exposes all the information you need to work with media messages through fields on theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jzszdznzzl/WABotJS/llms.txt
Use this file to discover all available pages before exploring further.
Message object. You can inspect the content type and MIME type to decide how to handle each message, download the raw bytes as a Buffer with a single method call, and send any kind of media back using m.reply().
Detecting Media Messages
Checkm.type to identify the kind of media in a message. Common type values are:
m.type | Description |
|---|---|
imageMessage | Photo |
videoMessage | Video clip |
audioMessage | Audio file or voice note |
documentMessage | File attachment (PDF, ZIP, etc.) |
stickerMessage | Sticker (static or animated) |
conversation / extendedTextMessage | Plain text (no media) |
m.url is defined as a secondary guard — media messages always have a CDN URL, while text messages do not.
Downloading Media
Callawait m.download() to fetch the media file and receive it as a Node.js Buffer. WABotJS handles CDN URL resolution and decryption using the url, key, and path fields internally.
Sending Media
Send media back to any chat usingm.reply() with the appropriate baileys.AnyMessageContent shape. Read the file into a Buffer first — from disk, a network request, or the result of m.download().
Media Message Fields
The followingMessage fields are populated for media messages and undefined for plain-text messages:
Baileys content-type key identifying the media kind (e.g.
imageMessage, videoMessage,
audioMessage, documentMessage, stickerMessage). Unwrapped through ephemeral and view-once
wrappers automatically.MIME type reported by WhatsApp for the media file, e.g.
"image/jpeg", "video/mp4",
"audio/ogg; codecs=opus". Use this to pick the right file extension or processing pipeline.The
fileSha256 checksum of the media file as a Buffer. Useful for deduplication or integrity
verification after download.The
mediaKey Buffer used to decrypt the downloaded ciphertext. Required internally by
m.download().A
URL object pointing to the WhatsApp CDN location of the encrypted media file.The
directPath string that complements url for media resolution. Required internally by
m.download().