retrieveUserByIdOrNull

suspend fun JDA.retrieveUserByIdOrNull(userId: String, useCache: Boolean = true): User?(source)
suspend fun JDA.retrieveUserByIdOrNull(userId: Long, useCache: Boolean = true): User?(source)

Retrieves a User with the provided ID.

Throws the same exceptions as JDA.retrieveUserById, minus ErrorResponse.UNKNOWN_USER.

Parameters

userId

ID of the user to retrieve

useCache

Whether this should rely on the cache, set to false to always make a request.

See also