Events
Events
onMemberJoined
- client.chat.listen(
{ onMemberJoined: Callback })
Emitted when a new member joins the chat. Your event handler will be called with an instance of ChatMember.
Parameters
The member that joined. See ChatMember.
onMemberLeft
- client.chat.listen(
{ onMemberLeft: Callback })
Emitted when a member leaves the chat. Your event handler will be called with an instance of ChatMember.
Parameters
The member that left. See ChatMember.
onMemberUpdated
- client.chat.listen(
{ onMemberUpdated: Callback })
Emitted when a member updates its state. Your event handler will be called with an instance of ChatMember.
Parameters
The member that was updated. See ChatMember.
onMessageReceived
- client.chat.listen(
{ onMessageReceived: Callback})
Emitted when a message is received. Your event handler will be called with an instance of ChatMessage.
Parameters
The message that was received. See ChatMessage.
Type Aliases
ChatMemberEntity
An object representing a Chat Member with only the state properties of ChatMember.
Properties
Readonlychannel:string
The channel of this member.
Readonlyid:string
The id of this member.
Readonlystate:Record<any,any>
The state of this member.
ChatMessageEntity
An object representing a Chat Message with only the state properties of ChatMessage.
Properties
Readonlycontent:any
The content of this message.
Readonlyid:string
The id. of this message
Readonlymember:ChatMember
The member which sent this message.
Readonlymeta?:any
Any metadata associated with this message.
ReadonlypublishedAt:Date
The date and time at which this message was published.
PaginationCursor
This is a utility object that aids in pagination. It is specifically used in conjunction with the getMessages method.
Properties
Readonlyafter?:string
This property signifies the cursor for the subsequent page.
Readonlybefore?:string
This property signifies the cursor for the preceding page.