Skip to main content

Get Member State

Fetches the state and details of a community member, including rights, tool state, and membership status. This function provides information about the member's rights, whether edits are required, and other member-specific data.

Steps to get the member state

  1. Call the getMemberState() function using the instance of LMChatClient, passing an optional response handler.
  2. Process the response LMResponse<GetMemberStateResponse> to handle the member state data or any errors.
CommunityClient.shared.getMemberState { response in
if let result = response?.data {
// Handle success
print("Member state: \(result.state ?? -1)")
print("Member details: \(result.member)")
} else if let error = response?.error {
// Handle error
print("Error fetching member state: \(error.localizedDescription)")
}
}

Models

GetMemberStateResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
createdAtString?The creation timestamp of the member state✔️
editRequiredBool?Indicates if the member requires edits to their profile✔️
memberUser?The member's user information✔️
managerRights[ManagerRight]?List of manager-specific rights in the community✔️
memberRights[MemberRight]?List of rights the member holds in the community✔️
stateInt?The current state of the member✔️
toolStateInt?The tool state of the member✔️

Member Right

VARIABLETYPEDESCRIPTIONOPTIONAL
idInt?Unique identifier of the member right✔️
isLockedBool?Indicates if the right is locked✔️
isSelectedBool?Indicates if the right is selected✔️
stateMemberRightState?The state representing the member right✔️
titleString?Title of the member right✔️
subTitleString?Subtitle or description of the member right✔️

Member Right State

StateValue
createPolls1
respondsInChatRoom3

Manager Right

VARIABLETYPEDESCRIPTIONOPTIONAL
idInt?Unique identifier of the manager right:heavy_check_mark
isLockedBool?Indicates if the right is locked:heavy_check_mark
isSelectedBool?Indicates if the right is selected:heavy_check_mark
stateManagerRightState?The state representing the manager right:heavy_check_mark
titleString?Title of the manager right:heavy_check_mark
subTitleString?Subtitle or description of the manager right:heavy_check_mark

Manager Right State

StateValue
moderateChatRooms0