Skip to main content

Sending Messages

One of the core features of any messaging experience is sending messages.

This page contains all the examples you need to start sending messages with Baileys.

Text Messages​

Media Messages​

contextInfo, linkPreview, other formats​

Forwarding Messages​

Deleting messages​

Editing Messages​

Reaction Messages​

Sending Group Status Messages​

You can send a status message (status update) specifically targetting a group using the sendGroupStatus function.

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

const sock = makeWASocket({ ... })

// To send a group status message:
// You can pass the JID of the group, and the content (e.g. text, media, etc.)
await sock.sendGroupStatus('[email protected]', { text: 'Hello, this is a group status!' })

// Or call the standalone function:
await sendGroupStatus(sock, '[email protected]', { text: 'Hello, this is a group status!' })

Sending Channel Status Messages​

You can send a status message to a WhatsApp Channel (newsletter) using the sendChannelStatus function.

This is analogous to sendGroupStatus but targets a @newsletter JID instead of a @g.us group JID.

import { makeWASocket, sendChannelStatus } from 'amiudmodz'

const sock = makeWASocket({ ... })

// Send a text status update to a channel:
await sock.sendChannelStatus('1234567890@newsletter', { text: 'Hello from the channel!' })

// Send an image status to a channel:
await sock.sendChannelStatus('1234567890@newsletter', {
image: { url: 'https://example.com/image.jpg' },
caption: 'Channel update!'
})

// Or call the standalone function:
await sendChannelStatus(sock, '1234567890@newsletter', { text: 'Hello from the channel!' })

note about disappearing mode (ephemeralExpiration)​