Events

View as Markdown

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

member
ChatMemberRequired

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

member
ChatMemberRequired

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

member
ChatMemberRequired

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

message
ChatMessageRequired

The message that was received. See ChatMessage.

Type Aliases

ChatMemberEntity

An object representing a Chat Member with only the state properties of ChatMember.

Properties

  • Readonly channel: string

The channel of this member.

  • Readonly id: string

The id of this member.

  • Readonly state: Record<any,any>

The state of this member.


ChatMessageEntity

An object representing a Chat Message with only the state properties of ChatMessage.

Properties

  • Readonly content: any

The content of this message.

  • Readonly id: string

The id. of this message

The member which sent this message.

  • Readonly meta?: any

Any metadata associated with this message.

  • Readonly publishedAt: 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

  • Readonly after?: string

This property signifies the cursor for the subsequent page.

  • Readonly before?: string

This property signifies the cursor for the preceding page.