User

@Serializable
data class User(val id: String, val username: String, val discriminator: Long, val avatarHash: String?, val isBot: Boolean? = null, val isSystem: Boolean? = null, val twoFactorAuthEnabled: Boolean? = null, val locale: String? = null, val isVerified: Boolean? = null, val email: String? = null, val flags: UserFlags = UserFlags.NONE, val premiumType: PremiumType? = null, val publicFlags: UserFlags = UserFlags.NONE)(source)

Constructors

Link copied to clipboard
constructor(id: String, username: String, discriminator: Long, avatarHash: String?, isBot: Boolean? = null, isSystem: Boolean? = null, twoFactorAuthEnabled: Boolean? = null, locale: String? = null, isVerified: Boolean? = null, email: String? = null, flags: UserFlags = UserFlags.NONE, premiumType: PremiumType? = null, publicFlags: UserFlags = UserFlags.NONE)

Properties

Link copied to clipboard
@SerialName(value = "avatar")
val avatarHash: String?
Link copied to clipboard
@SerialName(value = "discriminator")
val discriminator: Long
Link copied to clipboard
@SerialName(value = "email")
val email: String? = null
Link copied to clipboard
@SerialName(value = "flags")
val flags: UserFlags
Link copied to clipboard

Convenience method to check if a user has a custom avatar.

Link copied to clipboard
@SerialName(value = "id")
val id: String
Link copied to clipboard
@SerialName(value = "bot")
val isBot: Boolean? = null
Link copied to clipboard
@SerialName(value = "system")
val isSystem: Boolean? = null
Link copied to clipboard
@SerialName(value = "verified")
val isVerified: Boolean? = null
Link copied to clipboard
@SerialName(value = "locale")
val locale: String? = null
Link copied to clipboard

Convenience method to turn a user into a formatted mention for chat.

Link copied to clipboard
@SerialName(value = "premium_type")
val premiumType: PremiumType? = null
Link copied to clipboard
@SerialName(value = "public_flags")
val publicFlags: UserFlags
Link copied to clipboard
@SerialName(value = "mfa_enabled")
val twoFactorAuthEnabled: Boolean? = null
Link copied to clipboard
@SerialName(value = "username")
val username: String

Functions

Link copied to clipboard
fun User.gifAvatar(size: Int? = null): String?

Gets the url of the user's avatar in GIF format.

Link copied to clipboard
fun User.jpgAvatar(size: Int? = null): String?

Gets the url of the user's avatar in JPG format.

Link copied to clipboard
fun User.pngAvatar(size: Int? = null): String

Gets the url of the user's avatar in PNG format.

Link copied to clipboard
fun User.pngDefaultAvatar(size: Int? = null): String

Gets the url of the user's default avatar in PNG format.

Link copied to clipboard
fun User.webpAvatar(size: Int? = null): String?

Gets the url of the user's avatar in WEBP format.