setMemberState

View as Markdown

setMemberState

  • setMemberState(params): Promise<void>

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

Parameters

NameTypeDescription
paramsObject-
params.channelsstring | string[]Channels for which to set the state.
params.memberIdstringId of the member to affect.
params.stateRecord<any, any>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});