docs/GroupChat.html
archivedcreatedAtdescriptionidisGroupisLocked
isMutedisReadOnlylastMessagemuteExpirationnameowner
participantspinnedtimestampunreadCount
addOrEditCustomerNote(note)addParticipants(participantIds, options)approveGroupMembershipRequests(options)archive()changeLabels(labelIds)clearMessages()clearState()delete()deletePicture()demoteParticipants(participantIds)fetchMessages(searchOptions)getContact()getCustomerNote()
getGroupMembershipRequests()getInviteCode()getLabels()getPinnedMessages()leave()markUnread()mute(unmuteDate)pin()promoteParticipants(participantIds)rejectGroupMembershipRequests(options)removeParticipants(participantIds)revokeInvite()sendMessage(content[, options])
sendSeen()sendStateRecording()sendStateTyping()setAddMembersAdminsOnly([adminsOnly])setDescription(description)setInfoAdminsOnly([adminsOnly])setMessagesAdminsOnly([adminsOnly])setPicture(media)setSubject(subject)syncHistory()unarchive()unmute()unpin()
ExtendsChat
Indicates if the Chat is archived
Inherited fromChat#archived
Gets the date at which the group was created
Gets the group description
ID that represents the chat
Inherited fromChat#id
Indicates if the Chat is a Group Chat
Inherited fromChat#isGroup
Indicates if the Chat is locked
Inherited fromChat#isLocked
Indicates if the chat is muted or not
Inherited fromChat#isMuted
Indicates if the Chat is readonly
Inherited fromChat#isReadOnly
Last message fo chat
Inherited fromChat#lastMessage
Unix timestamp for when the mute expires
Inherited fromChat#muteExpiration
Title of the chat
Inherited fromChat#name
Gets the group owner
Gets the group participants
Indicates if the Chat is pinned
Inherited fromChat#pinned
Unix timestamp for when the last activity occurred
Inherited fromChat#timestamp
Amount of messages unread
Inherited fromChat#unreadCount
async
Add or edit a customer note
| Name | Type | Optional | Description |
|---|---|---|---|
note
|
|
|
The note to add
|
Inherited fromChat#addOrEditCustomerNoteSee alsohttps://faq.whatsapp.com/1433099287594476Returns async
Adds a list of participants by ID to the group
| Name | Type | Optional | Description |
|---|---|---|---|
participantIds
|
(string or Array of string)
|
| | |
options
|
|
|
An object thay handles options for adding participants
|
Returns
Promise containing (Object with AddParticipantsResult properties or string)
Returns an object with the resulting data or an error message as a string
async
Approves membership requests if any
| Name | Type | Optional | Description |
|---|---|---|---|
options
|
MembershipRequestActionOptions
|
|
Options for performing a membership request action
|
Returns
Promise containing Array of MembershipRequestActionResult
Returns an array of requester IDs whose membership requests were approved and an error for each requester, if any occurred during the operation. If there are no requests, an empty array will be returned
async
Archives this chat
Inherited fromChat#archive async
Add or remove labels to this Chat
| Name | Type | Optional | Description |
|---|---|---|---|
labelIds
|
|
| |
Inherited fromChat#changeLabelsReturns async
Clears all messages from the chat
Inherited fromChat#clearMessagesReturns
result
async
Stops typing or recording in chat immediately.
Inherited fromChat#clearState async
Deletes the chat
Inherited fromChat#deleteReturns
result
async
Deletes the group's picture.
Returns
Promise containing boolean
Returns true if the picture was properly deleted. This can return false if the user does not have the necessary permissions.
async
Demotes participants by IDs to regular users
| Name | Type | Optional | Description |
|---|---|---|---|
participantIds
|
Array of string
|
| |
Returns
Promise containing {status: number}
Object with status code indicating if the operation was successful
async
Loads chat messages, sorted from earliest to latest.
| Name | Type | Optional | Description |
|---|---|---|---|
searchOptions
|
|
|
Options for searching messages. Right now only limit and fromMe is supported.
Values in searchOptions have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
limit
|
|
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
|
|
Yes
|
Return only messages from the bot number or vise versa. To get all messages, leave the option undefined.
|
|
Inherited fromChat#fetchMessagesReturns async
Returns the Contact that corresponds to this Chat.
Inherited fromChat#getContactReturns async
Get a customer note
Inherited fromChat#getCustomerNoteSee alsohttps://faq.whatsapp.com/1433099287594476Returns async
Gets an array of membership requests
Returns
Promise containing Array of GroupMembershipRequest
An array of membership requests
async
Gets the invite code for a specific group
Returns
Promise containing string
Group's invite code
async
Returns array of all Labels assigned to this Chat
Inherited fromChat#getLabelsReturns async
Gets instances of all pinned messages in a chat
Inherited fromChat#getPinnedMessagesReturns async
Makes the bot leave the group
Returns
Promise
async
Mark this chat as unread
Inherited fromChat#markUnread async
Mutes this chat forever, unless a date is specified
| Name | Type | Optional | Description |
|---|---|---|---|
unmuteDate
|
|
|
Date when the chat will be unmuted, don't provide a value to mute forever
Value can be null.
|
Inherited fromChat#muteReturns async
Pins this chat
Inherited fromChat#pinReturns
New pin state. Could be false if the max number of pinned chats was reached.
async
Promotes participants by IDs to admins
| Name | Type | Optional | Description |
|---|---|---|---|
participantIds
|
Array of string
|
| |
Returns
Promise containing {status: number}
Object with status code indicating if the operation was successful
async
Rejects membership requests if any
| Name | Type | Optional | Description |
|---|---|---|---|
options
|
MembershipRequestActionOptions
|
|
Options for performing a membership request action
|
Returns
Promise containing Array of MembershipRequestActionResult
Returns an array of requester IDs whose membership requests were rejected and an error for each requester, if any occurred during the operation. If there are no requests, an empty array will be returned
async
Removes a list of participants by ID to the group
| Name | Type | Optional | Description |
|---|---|---|---|
participantIds
|
Array of string
|
| |
Returns
Promise containing {status: number}
async
Invalidates the current group invite code and generates a new one
Returns
Promise containing string
New invite code
async
Send a message to this chat
| Name | Type | Optional | Description |
|---|---|---|---|
content
|
|
| | |
options
|
|
Yes
| |
Inherited fromChat#sendMessageReturns
Message that was just sent
async
Sets the chat as seen
Inherited fromChat#sendSeenReturns
result
async
Simulate recording audio in chat. This will last for 25 seconds.
Inherited fromChat#sendStateRecording async
Simulate typing in chat. This will last for 25 seconds.
Inherited fromChat#sendStateTyping async
Updates the group setting to allow only admins to add members to the group.
| Name | Type | Optional | Description |
|---|---|---|---|
adminsOnly
|
boolean
|
Yes
|
Enable or disable this option
Defaults to true.
|
Returns
Promise containing boolean
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
async
Updates the group description
| Name | Type | Optional | Description |
|---|---|---|---|
description
|
string
|
| |
Returns
Promise containing boolean
Returns true if the description was properly updated. This can return false if the user does not have the necessary permissions.
async
Updates the group settings to only allow admins to edit group info (title, description, photo).
| Name | Type | Optional | Description |
|---|---|---|---|
adminsOnly
|
boolean
|
Yes
|
Enable or disable this option
Defaults to true.
|
Returns
Promise containing boolean
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
async
Updates the group settings to only allow admins to send messages.
| Name | Type | Optional | Description |
|---|---|---|---|
adminsOnly
|
boolean
|
Yes
|
Enable or disable this option
Defaults to true.
|
Returns
Promise containing boolean
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
async
Sets the group's picture.
| Name | Type | Optional | Description |
|---|---|---|---|
media
|
|
| |
Returns
Promise containing boolean
Returns true if the picture was properly updated. This can return false if the user does not have the necessary permissions.
async
Updates the group subject
| Name | Type | Optional | Description |
|---|---|---|---|
subject
|
string
|
| |
Returns
Promise containing boolean
Returns true if the subject was properly updated. This can return false if the user does not have the necessary permissions.
async
Sync chat history conversation
Inherited fromChat#syncHistoryReturns
True if operation completed successfully, false otherwise.
async
un-archives this chat
Inherited fromChat#unarchive async
Unmutes this chat
Inherited fromChat#unmuteReturns async
Unpins this chat
Inherited fromChat#unpinReturns
New pin state