getMemberState

View as Markdown

getMemberState

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

Returns the states of a member in the specified channels.

Parameters

NameTypeDescription
paramsObject-
params.channels?string | string[]Channels for which to get the state.
params.memberIdstringId 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