# whatsapp-web.js 1.2.1-post » Class: GroupChat

## Properties

archived
createdAt
description
id

isGroup
isReadOnly
name
owner

participants
timestamp
unreadCount

## Methods

getInviteInfo(inviteCode)
join(inviteCode)
addParticipants(participantIds)
archive()
clearMessages()
clearState()
delete()

demoteParticipants(participantIds)
fetchMessages(searchOptions)
getInviteCode()
leave()
promoteParticipants(participantIds)
removeParticipants(participantIds)
revokeInvite()

sendMessage(content, options)
sendSeen()
sendStateRecording()
sendStateTyping()
setDescription(description)
setSubject(subject)
unarchive()

## new GroupChat()

Extends
  Chat

## Properties

### archived unknown

Indicates if the Chat is archived

Inherited from
  Chat#archived

### 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

async static

### 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 object`

  Invite information

async static

### join(inviteCode)

Joins a group with an invite code

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
inviteCode | string |  |

async

### addParticipants(participantIds)

Adds a list of participants by ID to the group

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
participantIds | Array of string |  |

async

### archive()

Archives this chat

Inherited from
  Chat#archive

async

### clearMessages() → Promise containing Boolean

Clears all messages from the chat

Inherited from
  Chat#clearMessages
Returns

  result

async

### clearState()

Stops typing or recording in chat immediately.

Inherited from
  Chat#clearState

async

### delete() → Promise containing Boolean

Deletes the chat

Inherited from
  Chat#delete
Returns

  result

async

### demoteParticipants(participantIds)

Demotes participants by IDs to regular users

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
participantIds | Array of string |  |

async

### fetchMessages(searchOptions) → Promise containing Array of Message

Loads chat messages, sorted from earliest to latest.

#### Parameters

Name | Type | Optional | Description
--- | --- | --- | ---

searchOptions

Options for searching messages. Right now only limit is supported.

Values in `searchOptions` have the following properties:

Name | Type | Optional | Description
--- | --- | --- | ---
limit |  | Yes | The amount of messages to return. 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. Defaults to `50`.

Inherited from
  Chat#fetchMessages
Returns

async

### getInviteCode()

Gets the invite code for a specific group

async

### leave()

Makes the bot leave the group

async

### promoteParticipants(participantIds)

Promotes participants by IDs to admins

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
participantIds | Array of string |  |

async

### removeParticipants(participantIds)

Removes a list of participants by ID to the group

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
participantIds | Array of string |  |

async

### revokeInvite()

Invalidates the current group invite code and generates a new one

async

### 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

async

### sendSeen() → Promise containing Boolean

Set the message as seen

Inherited from
  Chat#sendSeen
Returns

  result

async

### sendStateRecording()

Simulate recording audio in chat. This will last for 25 seconds.

Inherited from
  Chat#sendStateRecording

async

### sendStateTyping()

Simulate typing in chat. This will last for 25 seconds.

Inherited from
  Chat#sendStateTyping

async

### setDescription(description)

Updates the group description

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
description | string |  |

async

### setSubject(subject)

Updates the group subject

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
subject | string |  |

async

### unarchive()

un-archives this chat

Inherited from
  Chat#unarchive