Skip to main content
Chat types represent WhatsApp conversations with their metadata and state.

Chat

Extends proto.IConversation with additional Baileys-specific fields.
string
Chat JID (identifier)Examples:
  • "1234567890@s.whatsapp.net" (individual chat)
  • "123456789@g.us" (group chat)
  • "status@broadcast" (status broadcasts)
number | Long
Timestamp of the conversation
number
Unix timestamp of when the last message was received in the chat (Baileys extension)
number
Number of unread messages
boolean
Whether the chat is archived
number
Pin position (0 = not pinned, higher = pinned earlier)
number | Long
Unix timestamp when mute expires (0 = not muted)
string
Chat name (for groups, business accounts, or saved contacts)
boolean
Whether the chat is marked as not spam
number
Disappearing messages expiration time in secondsCommon values:
  • 0 - disabled
  • 86400 - 24 hours
  • 604800 - 7 days
  • 7776000 - 90 days
number | Long
When disappearing messages setting was last changed

ChatUpdate

Partial update to a chat’s properties.
function
Optional condition to check before applying the update
Returns:
  • true - apply the update
  • false - discard the update
  • undefined - condition not yet fulfilled, buffer the update
number
Unix timestamp of when the update occurred
All other fields are from Partial<Chat>.

ChatModification

Union type for modifying chat properties. Each modification has a specific structure:
boolean
required
true to archive, false to unarchive
LastMessageList
required
Last messages in the chat for sync purposes
boolean
required
true to pin, false to unpin
number | null
required
  • null - unmute
  • Unix timestamp - mute until this time
  • Duration in seconds - mute for this long from now
boolean
required
true to mark as read, false to mark as unread
LastMessageList
required
Last messages to mark
boolean
required
Must be true
LastMessageList
required
Messages to clear
true
required
Must be true
LastMessageList
required
Last messages in chat

Supporting Types

LastMessageList

List of messages sorted reverse-chronologically (latest first). For MD modifications, the last message in the array must be the last message received in the chat.

PresenceData

WAPresence
required
Last known presence statusValues: 'unavailable', 'available', 'composing', 'recording', 'paused'
number
Unix timestamp of when user was last seen

WAPresence

Privacy Settings Types

WAPrivacyValue

WAPrivacyOnlineValue

WAPrivacyGroupAddValue

WAReadReceiptsValue

WAPrivacyCallValue

WAPrivacyMessagesValue

Usage Examples

Handling Chat Events

Modifying Chats

Working with Presence

Checking Chat State

Chat Sorting

  • Contact - Contact information
  • Message - Message types
  • Events - Event types including chat events
  • Groups - Group metadata and information