docs/Client.html
_muteUnmuteChat(chatId, action, unmuteDateTs)acceptChannelAdminInvite(channelId)acceptGroupV4Invite(inviteInfo)acceptInvite(inviteCode)addOrEditCustomerNote(userId, note)addOrRemoveLabels(labelIds, chatIds)approveGroupMembershipRequests(groupId, options)archiveChat()attachEventListeners()cancelPairingCode()createCallLink(startTime, callType)createChannel(title, options)createGroup(title, participants, options)deleteAddressbookContact(phoneNumber)deleteChannel(channelId)deleteProfilePicture()demoteChannelAdmin(channelId, userId)destroy()getBlockedContacts()getBroadcastById(contactId)getBroadcasts()getChannelByInviteCode(inviteCode)getChannels()getChatById(chatId)getChatLabels(chatId)getChats()getChatsByLabelId(labelId)getCommonGroups(contactId)
getContactById(contactId)getContactDeviceCount(userId)getContactLidAndPhone(userIds)getContacts()getCountryCode(number)getCustomerNote(userId)getFormattedNumber(number)getGroupMembershipRequests(groupId)getInviteInfo(inviteCode)getLabelById(labelId)getLabels()getMessageById(messageId)getNumberId(number)getPinnedMessages(chatId)getPollVotes(messageId)getProfilePicUrl(contactId)getState()getWWebVersion()initialize()inject()isRegisteredUser(id)logout()markChatUnread(chatId)muteChat(chatId, unmuteDate)pinChat()rejectGroupMembershipRequests(groupId, options)requestPairingCode(phoneNumber[, showNotification][, intervalMs])resetState()
revokeChannelAdminInvite(channelId, userId)revokeStatusMessage(messageId)saveOrEditAddressbookContact(phoneNumber, firstName, lastName[, syncToAddressbook])searchChannels(searchOptions)searchMessages(query[, options])sendChannelAdminInvite(chatId, channelId, options)sendMessage(chatId, content[, options])sendPresenceAvailable()sendPresenceUnavailable()sendReaction(messageId, reaction)sendResponseToScheduledEvent(response, eventMessageId)sendSeen(chatId)setAutoDownloadAudio(flag)setAutoDownloadDocuments(flag)setAutoDownloadPhotos(flag)setAutoDownloadVideos(flag)setBackgroundSync(flag)setDisplayName(displayName)setProfilePicture(media)setStatus(status)subscribeToChannel(channelId)syncHistory(chatId)transferChannelOwnership(channelId, newOwnerId, options)unarchiveChat()unmuteChat(chatId)unpinChat()unsubscribeFromChannel(channelId, options)
auth_failureauthenticatedchange_batterychange_statechat_archivedchat_removedcodecontact_changeddisconnectedgroup_admin_changed
group_joingroup_leavegroup_membership_requestgroup_updateincoming_callmedia_uploadedmessagemessage_ackmessage_ciphertextmessage_ciphertext_failed
message_createmessage_editmessage_reactionmessage_revoke_everyonemessage_revoke_meqrreadyvote_update
| Name | Type | Optional | Description |
|---|---|---|---|
options
|
|
|
Client options
Values in options have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
authStrategy
|
|
|
Determines how to save and restore sessions. If not set, NoAuth will be used.
| |
webVersion
|
|
|
The version of WhatsApp Web to use. Use options.webVersionCache to configure how the version is retrieved.
| |
webVersionCache
|
|
|
Determines how to retrieve the WhatsApp Web version. Defaults to a local cache (LocalWebCache) that falls back to latest if the requested version is not found.
| |
authTimeoutMs
|
|
|
Timeout for authentication selector in puppeteer
| |
evalOnNewDoc
|
|
|
function to eval on new doc
| |
puppeteer
|
|
|
Puppeteer launch options. View docs here: https://github.com/puppeteer/puppeteer/
| |
qrMaxRetries
|
|
|
How many times should the qrcode be refreshed before giving up
| |
takeoverOnConflict
|
|
|
If another whatsapp web session is detected (another browser), take over the session in the current browser
| |
takeoverTimeoutMs
|
|
|
How much time to wait before taking over the session
| |
userAgent
|
|
|
User agent to use in puppeteer
| |
ffmpegPath
|
|
|
Ffmpeg path to use when formatting videos to webp while sending stickers
| |
bypassCSP
|
|
|
Sets bypassing of page's Content-Security-Policy.
| |
deviceName
|
|
|
Sets the device name of a current linked device., i.e.: 'TEST'.
| |
browserName
|
|
|
Sets the browser name of a current linked device, i.e.: 'Firefox'.
| |
proxyAuthentication
|
|
|
Proxy Authentication object.
|
|
ExtendsEventEmitterFiresClient#event:qrClient#event:authenticatedClient#event:auth_failureClient#event:readyClient#event:messageClient#event:message_ackClient#event:message_createClient#event:message_revoke_meClient#event:message_revoke_everyoneClient#event:message_ciphertextClient#event:message_editClient#event:media_uploadedClient#event:group_joinClient#event:group_leaveClient#event:group_updateClient#event:disconnectedClient#event:change_stateClient#event:contact_changedClient#event:group_admin_changedClient#event:group_membership_requestClient#event:vote_update
Current connection information
async
Internal method to mute or unmute the chat
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
|
ID of the chat that will be muted/unmuted
| |
action
|
string
|
|
The action: 'MUTE' or 'UNMUTE'
| |
unmuteDateTs
|
number
|
|
Timestamp at which the chat will be unmuted
|
Returns
Promise containing {isMuted: boolean, muteExpiration: number}
async
Accepts a channel admin invitation and promotes the current user to a channel admin
| Name | Type | Optional | Description |
|---|---|---|---|
channelId
|
string
|
|
The channel ID to accept the admin invitation from
|
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
async
Accepts a private invitation to join a group
| Name | Type | Optional | Description |
|---|---|---|---|
inviteInfo
|
object
|
|
Invite V4 Info
|
Returns
Promise containing Object
async
Accepts an invitation to join a group
| Name | Type | Optional | Description |
|---|---|---|---|
inviteCode
|
string
|
|
Invitation code
|
Returns
Promise containing string
Id of the joined Chat
async
Add or edit a customer note
| Name | Type | Optional | Description |
|---|---|---|---|
userId
|
string
|
|
The ID of a customer to add a note to
| |
note
|
string
|
|
The note to add
|
See alsohttps://faq.whatsapp.com/1433099287594476Returns
Promise containing void
async
Change labels in chats
| Name | Type | Optional | Description |
|---|---|---|---|
labelIds
|
Array of (number or string)
|
| | |
chatIds
|
Array of string
|
| |
Returns
Promise containing void
async
Approves membership requests if any
| Name | Type | Optional | Description |
|---|---|---|---|
groupId
|
string
|
|
The group ID to get the membership request for
| |
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
Enables and returns the archive state of the Chat
Returns
boolean
async
Attach event listeners to WA Web Private function
| Name | Type | Optional | Description |
|---|---|---|---|
reinject
|
boolean
|
|
is this a reinject?
|
async
Cancels an active pairing code session and returns to QR code mode
async
Generates a WhatsApp call link (video call or voice call)
| Name | Type | Optional | Description |
|---|---|---|---|
startTime
|
Date
|
|
The start time of the call
| |
callType
|
string
|
|
The type of a WhatsApp call link to generate, valid values are: video | voice
|
Returns
Promise containing string
The WhatsApp call link (https://call.whatsapp.com/video/XxXxXxXxXxXxXx) or an empty string if a generation failed.
async
Creates a new channel
| Name | Type | Optional | Description |
|---|---|---|---|
title
|
string
|
|
The channel name
| |
options
|
|
| |
Returns
Promise containing (CreateChannelResult or string)
Returns an object that handles the result for the channel creation or an error message as a string
async
Creates a new group
| Name | Type | Optional | Description |
|---|---|---|---|
title
|
string
|
|
Group title
| |
participants
|
(string, Contact, Array of (Contact or string), or undefined)
|
|
A single Contact object or an ID as a string or an array of Contact objects or contact IDs to add to the group
| |
options
|
|
|
An object that handles options for group creation
|
Returns
Promise containing (CreateGroupResult or string)
Object with resulting data or an error message as a string
async
Deletes the contact from user's addressbook
| Name | Type | Optional | Description |
|---|---|---|---|
phoneNumber
|
string
|
|
The contact's phone number in a format "17182222222", where "1" is a country code
|
Returns
Promise containing void
async
Deletes the channel you created
| Name | Type | Optional | Description |
|---|---|---|---|
channelId
|
string
|
|
The ID of a channel to delete
|
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
async
Deletes the current user's profile picture.
Returns
Promise containing boolean
Returns true if the picture was properly deleted.
async
Demotes a channel admin to a regular subscriber (can be used also for self-demotion)
| Name | Type | Optional | Description |
|---|---|---|---|
channelId
|
string
|
|
The channel ID to demote an admin in
| |
userId
|
string
|
|
The user ID to demote
|
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
async
Closes the client
async
Gets all blocked contacts by host account
Returns
Promise containing Array of Contact
async
Get broadcast instance by current user ID
| Name | Type | Optional | Description |
|---|---|---|---|
contactId
|
string
|
| |
Returns
Promise containing Broadcast
async
Get all current Broadcast
Returns
Promise containing Array of Broadcast
async
Gets a Channel instance by invite code
| Name | Type | Optional | Description |
|---|---|---|---|
inviteCode
|
string
|
|
The code that comes after the 'https://whatsapp.com/channel/'
|
Returns
Promise containing Channel
async
Gets all cached Channel instance
Returns
Promise containing Array of Channel
async
Gets chat or channel instance by ID
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
| |
Returns
Promise containing (Chat or Channel)
async
Get all Labels assigned to a chat
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
| |
Returns
Promise containing Array of Label
async
Get all current chat instances
Returns
Promise containing Array of Chat
async
Get all Chats for a specific Label
| Name | Type | Optional | Description |
|---|---|---|---|
labelId
|
string
|
| |
Returns
Promise containing Array of Chat
async
Gets the Contact's common groups with you. Returns empty array if you don't have any common group.
| Name | Type | Optional | Description |
|---|---|---|---|
contactId
|
string
|
|
the whatsapp user's ID (_serialized format)
|
Returns
Promise containing Array of WAWebJS.ChatId
async
Get contact instance by ID
| Name | Type | Optional | Description |
|---|---|---|---|
contactId
|
string
|
| |
Returns
Promise containing Contact
async
Get user device count by ID Each WaWeb Connection counts as one device, and the phone (if exists) counts as one So for a non-enterprise user with one WaWeb connection it should return "2"
| Name | Type | Optional | Description |
|---|---|---|---|
userId
|
string
|
| |
Returns
Promise containing number
async
Get lid and phone number for multiple users
| Name | Type | Optional | Description |
|---|---|---|---|
userIds
|
Array of string
|
|
Array of user IDs
|
Returns
Promise containing Array of {lid: string, pn: string}
async
Get all current contact instances
Returns
Promise containing Array of Contact
async
Get the country code of a WhatsApp ID.
| Name | Type | Optional | Description |
|---|---|---|---|
number
|
string
|
|
Number or ID
|
Returns
Promise containing string
async
Get a customer note
| Name | Type | Optional | Description |
|---|---|---|---|
userId
|
string
|
|
The ID of a customer to get a note from
|
See alsohttps://faq.whatsapp.com/1433099287594476Returns
Promise containing {chatId: string, content: string, createdAt: number, id: string, modifiedAt: number, type: string}
async
Get the formatted number of a WhatsApp ID.
| Name | Type | Optional | Description |
|---|---|---|---|
number
|
string
|
|
Number or ID
|
Returns
Promise containing string
async
Gets an array of membership requests
| Name | Type | Optional | Description |
|---|---|---|---|
groupId
|
string
|
|
The ID of a group to get membership requests for
|
Returns
Promise containing Array of GroupMembershipRequest
An array of membership requests
async
Returns an object with information about the invite code's group
| Name | Type | Optional | Description |
|---|---|---|---|
inviteCode
|
string
|
| |
Returns
Promise containing object
Invite information
async
Get Label instance by ID
| Name | Type | Optional | Description |
|---|---|---|---|
labelId
|
string
|
| |
Returns
Promise containing Label
async
Get all current Labels
Returns
Promise containing Array of Label
async
Get message by ID
| Name | Type | Optional | Description |
|---|---|---|---|
messageId
|
string
|
| |
Returns
Promise containing Message
async
Get the registered WhatsApp ID for a number. Will return null if the number is not registered on WhatsApp.
| Name | Type | Optional | Description |
|---|---|---|---|
number
|
string
|
|
Number or ID ("@c.us" will be automatically appended if not specified)
|
Returns
Promise containing (Object or null)
async
Gets instances of all pinned messages in a chat
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
|
The chat ID
|
Returns
Promise containing Array of Message
async
Get Poll Votes
| Name | Type | Optional | Description |
|---|---|---|---|
messageId
|
string
|
| |
Returns
Promise containing Array of PollVote
async
Returns the contact ID's profile picture URL, if privacy settings allow it
| Name | Type | Optional | Description |
|---|---|---|---|
contactId
|
string
|
|
the whatsapp user's ID
|
Returns
Promise containing string
async
Gets the current connection state for the client
Returns
WAState
async
Returns the version of WhatsApp Web currently being run
Returns
Promise containing string
async
Sets up events and requirements, kicks off authentication request
async
Injection logic Private function
async
Check if a given ID is registered in whatsapp
| Name | Type | Optional | Description |
|---|---|---|---|
id
|
string
|
|
the whatsapp user's ID
|
Returns
Promise containing Boolean
async
Logs out the client, closing the current session
async
Mark the Chat as unread
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
|
ID of the chat that will be marked as unread
|
async
Mutes this chat forever, unless a date is specified
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
|
ID of the chat that will be muted
| |
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 the Chat
Returns
Promise containing boolean
New pin state. Could be false if the max number of pinned chats was reached.
async
Rejects membership requests if any
| Name | Type | Optional | Description |
|---|---|---|---|
groupId
|
string
|
|
The group ID to get the membership request for
| |
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
Request authentication via pairing code instead of QR code
| Name | Type | Optional | Description |
|---|---|---|---|
phoneNumber
|
string
|
|
Phone number in international, symbol-free format (e.g. 12025550108 for US, 551155501234 for Brazil)
| |
showNotification
|
boolean
|
Yes
|
Show notification to pair on phone number
Defaults to true.
| |
intervalMs
|
number
|
Yes
|
The interval in milliseconds on how frequent to generate pairing code (WhatsApp default to 3 minutes)
Defaults to 180000.
|
Returns
Promise containing string
async
Force reset of connection state for the client
async
Revokes a channel admin invitation sent to a user by a channel owner
| Name | Type | Optional | Description |
|---|---|---|---|
channelId
|
string
|
|
The channel ID an invitation belongs to
| |
userId
|
string
|
|
The user ID the invitation was sent to
|
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
async
Revoke current own status messages
| Name | Type | Optional | Description |
|---|---|---|---|
messageId
|
string
|
| |
Returns
Promise containing void
async
Save new contact to user's addressbook or edit the existing one
| Name | Type | Optional | Description |
|---|---|---|---|
phoneNumber
|
string
|
|
The contact's phone number in a format "17182222222", where "1" is a country code
| |
firstName
|
string
|
| | |
lastName
|
string
|
| | |
syncToAddressbook
|
boolean
|
Yes
|
If set to true, the contact will also be saved to the user's address book on their phone. False by default
Defaults to false.
|
Returns
Promise containing void
async
Searches for channels based on search criteria, there are some notes:
UnsubscribeOptions.deleteLocalModels set to 'true', the lastMessage property of a found channel will be 'null'| Name | Type | Optional | Description |
|---|---|---|---|
searchOptions
|
Object
|
|
Search options
Values in searchOptions have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
searchText
|
string
|
Yes
|
Text to search
Defaults to ''.
| |
countryCodes
|
Array of string
|
Yes
|
Array of country codes in 'ISO 3166-1 alpha-2' standart (@see https://en.wikipedia.org/wiki/ISO\_3166-1\_alpha-2) to search for channels created in these countries
Defaults to [your local region].
| |
skipSubscribedNewsletters
|
boolean
|
Yes
|
If true, channels that user is subscribed to won't appear in found channels
Defaults to false.
| |
view
|
number
|
Yes
|
View type, makes sense only when the searchText is empty. Valid values to provide are: 0 for RECOMMENDED channels 1 for TRENDING channels 2 for POPULAR channels 3 for NEW channels
Defaults to 0.
| |
limit
|
number
|
Yes
|
The limit of found channels to be appear in the returnig result
Defaults to 50.
|
|
Returns
Promise containing Array of Channel
Returns an array of Channel objects or an empty array if no channels were found
async
Searches for messages
| Name | Type | Optional | Description |
|---|---|---|---|
query
|
string
|
| | |
options
|
Object
|
Yes
|
Values in options have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
page
|
number
|
Yes
| | |
limit
|
number
|
Yes
| | |
chatId
|
string
|
Yes
| |
|
Returns
Promise containing Array of Message
async
Sends a channel admin invitation to a user, allowing them to become an admin of the channel
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
|
The ID of a user to send the channel admin invitation to
| |
channelId
|
string
|
|
The ID of a channel for which the invitation is being sent
| |
options
|
|
| |
Returns
Promise containing boolean
Returns true if an invitation was sent successfully, false otherwise
async
Send a message to a specific chatId
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
| | |
content
|
(string, MessageMedia, Location, Poll, Contact, Array of Contact, Buttons, or List)
|
| | |
options
|
|
Yes
|
Options used when sending the message
|
Returns
Promise containing Message
Message that was just sent
async
Marks the client as online
async
Marks the client as unavailable
async
Send an emoji reaction to a specific message
| Name | Type | Optional | Description |
|---|---|---|---|
messageId
|
string
|
|
Id of the message to add the reaction.
| |
reaction
|
string
|
|
Emoji to react with. Send an empty string to remove the reaction.
|
Returns
Promise
async
Sends a response to the scheduled event message, indicating whether a user is going to attend the event or not
| Name | Type | Optional | Description |
|---|---|---|---|
response
|
number
|
|
The response code to the scheduled event message. Valid values are: 0 for NONE response (removes a previous response) | 1 for GOING | 2 for NOT GOING | 3 for MAYBE going
| |
eventMessageId
|
string
|
|
The scheduled event message ID
|
Returns
Promise containing boolean
async
Mark as seen for the Chat
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
| |
Returns
Promise containing boolean
result
async
Setting autoload download audio
| Name | Type | Optional | Description |
|---|---|---|---|
flag
|
boolean
|
|
true/false
|
async
Setting autoload download documents
| Name | Type | Optional | Description |
|---|---|---|---|
flag
|
boolean
|
|
true/false
|
async
Setting autoload download photos
| Name | Type | Optional | Description |
|---|---|---|---|
flag
|
boolean
|
|
true/false
|
async
Setting autoload download videos
| Name | Type | Optional | Description |
|---|---|---|---|
flag
|
boolean
|
|
true/false
|
async
Setting background synchronization. NOTE: this action will take effect after you restart the client.
| Name | Type | Optional | Description |
|---|---|---|---|
flag
|
boolean
|
|
true/false
|
Returns
Promise containing boolean
async
Sets the current user's display name. This is the name shown to WhatsApp users that have not added you as a contact beside your number in groups and in your profile.
| Name | Type | Optional | Description |
|---|---|---|---|
displayName
|
string
|
|
New display name
|
Returns
Promise containing Boolean
async
Sets the current user's profile picture.
| Name | Type | Optional | Description |
|---|---|---|---|
media
|
|
| |
Returns
Promise containing boolean
Returns true if the picture was properly updated.
async
Sets the current user's status message
| Name | Type | Optional | Description |
|---|---|---|---|
status
|
string
|
|
New status message
|
async
Subscribe to channel
| Name | Type | Optional | Description |
|---|---|---|---|
channelId
|
string
|
|
The channel ID
|
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
async
Sync chat history conversation
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
| |
Returns
Promise containing boolean
True if operation completed successfully, false otherwise.
async
Transfers a channel ownership to another user. Note: the user you are transferring the channel ownership to must be a channel admin.
| Name | Type | Optional | Description |
|---|---|---|---|
channelId
|
string
|
| | |
newOwnerId
|
string
|
| | |
options
|
TransferChannelOwnershipOptions
|
| |
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
async
Changes and returns the archive state of the Chat
Returns
boolean
async
Unmutes the Chat
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
|
ID of the chat that will be unmuted
|
Returns
Promise containing {isMuted: boolean, muteExpiration: number}
async
Unpins the Chat
Returns
Promise containing boolean
New pin state
async
Unsubscribe from channel
| Name | Type | Optional | Description |
|---|---|---|---|
channelId
|
string
|
|
The channel ID
| |
options
|
|
| |
Returns
Promise containing boolean
Returns true if the operation completed successfully, false otherwise
Emitted when there has been an error while trying to restore an existing session
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
string
|
| |
Emitted when authentication is successful
Emitted when the battery percentage for the attached device changes. Will not be sent if using multi-device.
| Name | Type | Optional | Description |
|---|---|---|---|
batteryInfo
|
object
|
|
Values in batteryInfo have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
battery
|
number
|
|
The current battery percentage
| |
plugged
|
boolean
|
|
Indicates if the phone is plugged in (true) or not (false)
|
|
Deprecated
Emitted when the connection state changes
| Name | Type | Optional | Description |
|---|---|---|---|
state
|
|
|
the new connection state
|
Emitted when a chat is archived/unarchived
| Name | Type | Optional | Description |
|---|---|---|---|
chat
|
|
| | |
currState
|
boolean
|
| | |
prevState
|
boolean
|
| |
Emitted when a chat is removed
| Name | Type | Optional | Description |
|---|---|---|---|
chat
|
|
| |
Emitted when a pairing code is received
| Name | Type | Optional | Description |
|---|---|---|---|
code
|
string
|
|
Code
|
Returns
string
Code that was just received
Emitted when a contact or a group participant changes their phone number.
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
|
Message with more information about the event.
| |
oldId
|
String
|
|
The user's id (an old one) who changed their phone number and who triggered the notification.
| |
newId
|
String
|
|
The user's new id after the change.
| |
isContact
|
Boolean
|
|
Indicates if a contact or a group participant changed their phone number.
|
Emitted when the client has been disconnected
| Name | Type | Optional | Description |
|---|---|---|---|
reason
|
(WAState or "LOGOUT")
|
|
reason that caused the disconnect
|
Emitted when a current user is promoted to an admin or demoted to a regular user.
| Name | Type | Optional | Description |
|---|---|---|---|
notification
|
|
|
GroupNotification with more information about the action
|
Emitted when a user joins the chat via invite link or is added by an admin.
| Name | Type | Optional | Description |
|---|---|---|---|
notification
|
|
|
GroupNotification with more information about the action
|
Emitted when a user leaves the chat or is removed by an admin.
| Name | Type | Optional | Description |
|---|---|---|---|
notification
|
|
|
GroupNotification with more information about the action
|
Emitted when some user requested to join the group that has the membership approval mode turned on
| Name | Type | Optional | Description |
|---|---|---|---|
notification
|
|
|
GroupNotification with more information about the action
Values in notification have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
chatId
|
string
|
|
The group ID the request was made for
| |
author
|
string
|
|
The user ID that made a request
| |
timestamp
|
number
|
|
The timestamp the request was made at
|
|
Emitted when group settings are updated, such as subject, description or picture.
| Name | Type | Optional | Description |
|---|---|---|---|
notification
|
|
|
GroupNotification with more information about the action
|
Emitted when a call is received
| Name | Type | Optional | Description |
|---|---|---|---|
call
|
object
|
|
Values in call have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
id
|
number
|
|
Call id
| |
peerJid
|
string
|
|
Who called
| |
isVideo
|
boolean
|
|
if is video
| |
isGroup
|
boolean
|
|
if is group
| |
canHandleLocally
|
boolean
|
|
if we can handle in waweb
| |
outgoing
|
boolean
|
|
if is outgoing
| |
webClientShouldHandle
|
boolean
|
|
If Waweb should handle
| |
participants
|
object
|
|
Participants
|
|
Emitted when media has been uploaded for a message sent by the client.
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
|
The message with media that was uploaded
|
Emitted when a new message is received.
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
|
The message that was received
|
Emitted when an ack event occurrs on message type.
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
|
The message that was affected
| |
ack
|
|
|
The new ACK value
|
Emitted when a message is received as ciphertext (not yet decrypted)
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
| |
Emitted when a ciphertext message failed to decrypt after recovery attempt
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
| |
Emitted when a new message is created, which may include the current user's own messages.
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
|
The message that was created
|
Emitted when messages are edited
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
| | |
newBody
|
string
|
| | |
prevBody
|
string
|
| |
Emitted when a reaction is sent, received, updated or removed
| Name | Type | Optional | Description |
|---|---|---|---|
reaction
|
object
|
|
Values in reaction have the following properties:
| Name | Type | Optional | Description |
|---|---|---|---|
id
|
object
|
|
Reaction id
| |
orphan
|
number
|
|
Orphan
| |
orphanReason
|
string
|
|
Orphan reason
Value can be null.
| |
timestamp
|
number
|
|
Timestamp
| |
reaction
|
string
|
|
Reaction
| |
read
|
boolean
|
|
Read
| |
msgId
|
object
|
|
Parent message id
| |
senderId
|
string
|
|
Sender id
| |
ack
|
number
|
|
Ack
Value can be null.
|
|
Emitted when a message is deleted for everyone in the chat.
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
|
The message that was revoked, in its current state. It will not contain the original message's data.
| |
revoked_msg
|
|
|
The message that was revoked, before it was revoked. It will contain the message's original data. Note that due to the way this data is captured, it may be possible that this param will be undefined.
Value can be null.
|
Emitted when a message is deleted by the current user.
| Name | Type | Optional | Description |
|---|---|---|---|
message
|
|
|
The message that was revoked
|
Emitted when a QR code is received
| Name | Type | Optional | Description |
|---|---|---|---|
qr
|
string
|
|
QR Code
|
Emitted when the client has initialized and is ready to receive messages.
Emitted when some poll option is selected or deselected, shows a user's current selected option(s) on the poll