setMemberState

View as Markdown
  • setMemberState(params): Promise<void>

Sets a state object for a member, for the specified channels. The previous state object will be completely replaced.

Parameters

params
objectRequired

Configuration object for setting member state

params.channels
string | string[]Required

Channels for which to set the state.

params.memberId
stringRequired

Id of the member to affect. If not provided, defaults to the current member.

params.state
Record<any, any>Required

The state to set. There are no requirements on the content of the state.

Returns

Promise<void>

Example

1await chatClient.setMemberState({
2 channels: ["chan1", "chan2"],
3 state: {
4 online: true,
5 typing: false,
6 },
7});