setMemberState
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
params
Object containing the parameters of the method.
channels
Channels for which to set the state.
memberId
Id of the member to affect.
state
The state to set. There are no requirements on the content of the state.
Returns
Promise<void>
Example
In this example, we set the state of the member User1 in the channel channel1 to
{ online: true, typing: false }.
We then fetch the state of the member and print it to the console.