retrieveUserByIdOrNull

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

Deprecated

Moved to the BotCommands-jda-ktx module You can find & replace: Find: io.github.freya022.botcommands.api.core.utils.retrieveUserByIdOrNull Replace: dev.freya02.botcommands.jda.ktx.retrieve.retrieveUserByIdOrNull

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