Check DM Limit
Checks the direct message (DM) limit for a user. This function allows you to verify if a user has exceeded their DM limit and retrieve information about their current DM limitations.
Steps to check DM limit
- Create a CheckDMLimitRequest object using
CheckDMLimitRequest.builder()
class by passing the required parameter. - Call
checkDMLimit()
function using the instance ofLMChatClient
. - Process the response LMResponse<CheckDMLimitResponse> as per your requirement.
let request = CheckDMLimitRequest.builder()
.uuid("ENTER_UUID")
.build()
LMChatClient.shared.checkDMLimit(request: request) { response in
if let data = response.data {
// Process the DM limit check data
processDMLimitCheck(data)
} else if let error = response.error {
// Handle the error
handleError(error)
}
}
Models
CheckDMLimitRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
uuid | String? | Unique identifier for the user | ✔️ |
CheckDMLimitResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
chatroomId | Int? | ID of the chatroom (if applicable) | ✔️ |
isRequestDMLimitExceeded | Bool? | Indicates if the DM request limit is exceeded | ✔️ |
newRequestDMTimestamp | Double? | Timestamp for the next available DM request | ✔️ |
userDMLimit | DMLimitObject? | Object containing DM limit details | ✔️ |
DMLimitObject
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
state | Int? | Current state of the DM limit | ✔️ |
duration | String? | Duration for which the limit applies | ✔️ |
numberInDuration | Int? | Number of allowed DMs within the duration | ✔️ |