getMemberState

View as Markdown
  • getMemberState(params): Promise<{ channels: Record<string, ChatChannelState> }>

Returns the states of a member in the specified channels.

Parameters

params
objectRequired

Configuration object for getting member state

params.channels
string | string[]

Channels for which to get the state.

params.memberId
stringRequired

Id of the member for which to get the state.

Returns

Promise<{ channels: Record<string, ChatChannelState> }>

Example

1const s = await chatClient.getMemberState({
2 channels: ["chan1", "chan2"],
3 memberId: "my-member-id",
4});
5
6s.channels.length; // 2
7s.channels.chan1.state; // the state object for chan1