Skip to main content

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

  1. Create a CheckDMLimitRequest object using CheckDMLimitRequest.builder() class by passing the required parameter.
  2. Call checkDMLimit() function using the instance of LMChatClient.
  3. 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

VARIABLETYPEDESCRIPTIONOPTIONAL
uuidString?Unique identifier for the user✔️

CheckDMLimitResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
chatroomIdInt?ID of the chatroom (if applicable)✔️
isRequestDMLimitExceededBool?Indicates if the DM request limit is exceeded✔️
newRequestDMTimestampDouble?Timestamp for the next available DM request✔️
userDMLimitDMLimitObject?Object containing DM limit details✔️

DMLimitObject

VARIABLETYPEDESCRIPTIONOPTIONAL
stateInt?Current state of the DM limit✔️
durationString?Duration for which the limit applies✔️
numberInDurationInt?Number of allowed DMs within the duration✔️