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
- Call the
getMemberState()
function using the instance ofLMChatClient
, passing an optional response handler. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
createdAt | String? | The creation timestamp of the member state | ✔️ |
editRequired | Bool? | Indicates if the member requires edits to their profile | ✔️ |
member | User? | 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 | ✔️ |
state | Int? | The current state of the member | ✔️ |
toolState | Int? | The tool state of the member | ✔️ |
Member Right
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
id | Int? | Unique identifier of the member right | ✔️ |
isLocked | Bool? | Indicates if the right is locked | ✔️ |
isSelected | Bool? | Indicates if the right is selected | ✔️ |
state | MemberRightState? | The state representing the member right | ✔️ |
title | String? | Title of the member right | ✔️ |
subTitle | String? | Subtitle or description of the member right | ✔️ |
Member Right State
State | Value |
---|---|
createPolls | 1 |
respondsInChatRoom | 3 |
Manager Right
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
id | Int? | Unique identifier of the manager right | :heavy_check_mark |
isLocked | Bool? | Indicates if the right is locked | :heavy_check_mark |
isSelected | Bool? | Indicates if the right is selected | :heavy_check_mark |
state | ManagerRightState? | The state representing the manager right | :heavy_check_mark |
title | String? | Title of the manager right | :heavy_check_mark |
subTitle | String? | Subtitle or description of the manager right | :heavy_check_mark |
Manager Right State
State | Value |
---|---|
moderateChatRooms | 0 |