DyteChat
This is the chat module, which can be used to send and receive messages from the meeting.
- DyteChat
- .messages
- .channels
- .roomJoined
- .pinned
- .sendTextMessage(message)
- .sendImageMessage(image)
- .sendFileMessage(file)
- .sendMessage(message, participantIds)
- .getMessagesByUser(userId)
- .getMessagesByType(type)
- .pin(id)
- .unpin(id)
- .getMessages()
- .createChannel()
- .updateChannel()
- .sendMessageToChannel(message, channelId)
- .getChannelMembers()
- .searchMessages()
- .markLastReadMessage()
chat.messages
An array of chat messages.
chat.channels
An Array of all available channels.
chat.roomJoined
Returns true if the local participant has joined the meeting.
chat.pinned
Returns an array of pinned messages.
chat.sendTextMessage(message)
Sends a chat text message to the room.
Param | Description |
---|---|
message | The message that must be sent to the room. |
chat.sendImageMessage(image)
Sends an image message to the meeting.
Param | Description |
---|---|
image | The image that is to be sent. |
chat.sendFileMessage(file)
Sends a file to the meeting.
Param | Description |
---|---|
file | A File object. |
chat.sendMessage(message, participantIds)
Sends a message to the meeting. This method can be used to send text, image,
or file messages. The message type is determined by the key 'type' in message
object.
Param | Description |
---|---|
message | An object including the type and content of the message. |
participantIds | An array including the userIds of the participants. |
chat.getMessagesByUser(userId)
Returns an array of messages sent by a specific userId.
Param | Description |
---|---|
userId | The user id of the user that sent the message. |
chat.getMessagesByType(type)
Returns an array of 'text', 'image' or 'file' messages.
Param | Description |
---|---|
type | 'text', 'image', or 'file'. |
chat.pin(id)
Pins a chat message
Param | Description |
---|---|
id | ID of the message to be pinned |
chat.unpin(id)
Unpins a chat message
Param | Description |
---|---|
id | ID of the message to be unpinned |
chat.getMessages()
Gets chat messages in a paginated manner
chat.createChannel()
Creates a channel with specified name and userIds as members
chat.updateChannel()
Updates the channel
chat.sendMessageToChannel(message, channelId)
Sends a message to a channel. This method can be used to send text, image,
or file messages. The message type is determined by the key 'type' in message
object.
Param | Description |
---|---|
message | An object including the type and content of the message. |
channelId | Id of the channel where you want to send the message. |
chat.getChannelMembers()
returns a list of members added to the channel
chat.searchMessages()
search messages
chat.markLastReadMessage()
marks last read message in a channel