GroupChat
Source: structures/
Represents a Group Chat on WhatsApp
Properties
Methods
new GroupChat()
- Extends
- Chat
Properties
createdAt date
Gets the date at which the group was created
description string
Gets the group description
id unknown
ID that represents the chat
- Inherited from
- Chat#id
isGroup unknown
Indicates if the Chat is a Group Chat
- Inherited from
- Chat#isGroup
isReadOnly unknown
Indicates if the Chat is readonly
- Inherited from
- Chat#isReadOnly
name unknown
Title of the chat
- Inherited from
- Chat#name
owner
Gets the group owner
participants array
Gets the group participants
timestamp unknown
Unix timestamp for when the chat was created
- Inherited from
- Chat#timestamp
unreadCount unknown
Amount of messages unread
- Inherited from
- Chat#unreadCount
Methods
getInviteInfo(inviteCode) → Promise containing object
Returns an object with information about the invite code's group
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
inviteCode |
string |
|
- Returns
-
Promise containing objectInvite information
join(inviteCode)
Joins a group with an invite code
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
inviteCode |
string |
|
addParticipants(participantIds)
Adds a list of participants by ID to the group
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
participantIds |
Array of string |
|
demoteParticipants(participantIds)
Demotes participants by IDs to regular users
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
participantIds |
Array of string |
|
getInviteCode()
Gets the invite code for a specific group
leave()
Makes the bot leave the group
promoteParticipants(participantIds)
Promotes participants by IDs to admins
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
participantIds |
Array of string |
|
removeParticipants(participantIds)
Removes a list of participants by ID to the group
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
participantIds |
Array of string |
|
revokeInvite()
Invalidates the current group invite code and generates a new one
sendMessage(content, options) → Promise containing Message
Send a message to this chat
Parameters
| Name | Type | Optional | Description |
|---|---|---|---|
|
content |
|
|
|
|
options |
|
|
- Inherited from
- Chat#sendMessage
- Returns
-
Message that was just sent
setDescription(description)
Updates the group description
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
description |
string |
|
setSubject(subject)
Updates the group subject
Parameter
| Name | Type | Optional | Description |
|---|---|---|---|
|
subject |
string |
|