docs/Chat.html
isMutedisReadOnlylastMessagemuteExpiration
namepinnedtimestampunreadCount
addOrEditCustomerNote(note)archive()changeLabels(labelIds)clearMessages()clearState()delete()fetchMessages(searchOptions)getContact()
getCustomerNote()getLabels()getPinnedMessages()markUnread()mute(unmuteDate)pin()sendMessage(content[, options])sendSeen()
sendStateRecording()sendStateTyping()syncHistory()unarchive()unmute()unpin()
ExtendsBase
Indicates if the Chat is archived
ID that represents the chat
Indicates if the Chat is a Group Chat
Indicates if the Chat is locked
Indicates if the chat is muted or not
Indicates if the Chat is readonly
Last message fo chat
Unix timestamp for when the mute expires
Title of the chat
Indicates if the Chat is pinned
Unix timestamp for when the last activity occurred
Amount of messages unread
async
Add or edit a customer note
| Name | Type | Optional | Description |
|---|---|---|---|
note
|
string
|
|
The note to add
|
See alsohttps://faq.whatsapp.com/1433099287594476Returns
Promise containing void
async
Archives this chat
async
Add or remove labels to this Chat
| Name | Type | Optional | Description |
|---|---|---|---|
labelIds
|
Array of (number or string)
|
| |
Returns
Promise containing void
async
Clears all messages from the chat
Returns
Promise containing boolean
result
async
Stops typing or recording in chat immediately.
async
Deletes the chat
Returns
Promise containing Boolean
result
async
Loads chat messages, sorted from earliest to latest.
| Name | Type | Optional | Description |
|---|---|---|---|
searchOptions
|
Object
|
|
Options for searching messages. Right now only limit and fromMe is supported.
Values in searchOptions have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
limit
|
Number
|
Yes
|
The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
| |
fromMe
|
Boolean
|
Yes
|
Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.
|
|
Returns
Promise containing Array of Message
async
Returns the Contact that corresponds to this Chat.
Returns
Promise containing Contact
async
Get a customer note
See alsohttps://faq.whatsapp.com/1433099287594476Returns
Promise containing {chatId: string, content: string, createdAt: number, id: string, modifiedAt: number, type: string}
async
Returns array of all Labels assigned to this Chat
Returns
Promise containing Array of Label
async
Gets instances of all pinned messages in a chat
Returns
Promise containing Array of Message
async
Mark this chat as unread
async
Mutes this chat forever, unless a date is specified
| Name | Type | Optional | Description |
|---|---|---|---|
unmuteDate
|
Date
|
|
Date when the chat will be unmuted, don't provide a value to mute forever
Value can be null.
|
Returns
Promise containing {isMuted: boolean, muteExpiration: number}
async
Pins this chat
Returns
Promise containing boolean
New pin state. Could be false if the max number of pinned chats was reached.
async
Send a message to this chat
| Name | Type | Optional | Description |
|---|---|---|---|
content
|
(string, MessageMedia, or Location)
|
| | |
options
|
|
Yes
| |
Returns
Promise containing Message
Message that was just sent
async
Sets the chat as seen
Returns
Promise containing Boolean
result
async
Simulate recording audio in chat. This will last for 25 seconds.
async
Simulate typing in chat. This will last for 25 seconds.
async
Sync chat history conversation
Returns
Promise containing boolean
True if operation completed successfully, false otherwise.
async
un-archives this chat
async
Unmutes this chat
Returns
Promise containing {isMuted: boolean, muteExpiration: number}
async
Unpins this chat
Returns
Promise containing boolean
New pin state