User

open class User(val data: UserData, val kord: Kord, val supplier: EntitySupplier = kord.defaultSupplier) : UserBehavior(source)

An instance of a Discord User.

Inheritors

Constructors

Link copied to clipboard
constructor(data: UserData, kord: Kord, supplier: EntitySupplier = kord.defaultSupplier)

Properties

Link copied to clipboard
Link copied to clipboard

The avatar of this user as an Asset.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The 4-digit code at the end of the user's discord tag.

Link copied to clipboard

The user's effective name, prioritizing globalName over username.

Link copied to clipboard

The user's display name, if it is set. For bots, this is the application name.

Link copied to clipboard
open override val id: Snowflake

The unique identifier of this entity.

Link copied to clipboard

Whether this user is a bot account.

Link copied to clipboard

Returns true if the user is the same as the bot.

Link copied to clipboard
open override val kord: Kord

The kord instance that created this object.

Link copied to clipboard
open val mention: String
Link copied to clipboard

The flags on a user's account, if present.

Link copied to clipboard
open override val supplier: EntitySupplier

The supplier used to request entities.

Link copied to clipboard
val tag: String

The complete user tag.

Link copied to clipboard

The username of this user.

Functions

Link copied to clipboard
open suspend fun asMember(guildId: Snowflake): Member

Requests to get the this behavior as a Member in the Guild with the guildId.

Link copied to clipboard
open suspend fun asMemberOrNull(guildId: Snowflake): Member?

Requests to get this behavior as a Member in the Guild with the guildId, returns null if the member isn't present.

Link copied to clipboard
open suspend override fun asUser(): User

Requests to get the this behavior as a User.

Link copied to clipboard
open suspend override fun asUserOrNull(): User

Requests to get this behavior as a User, returns null if the user isn't present.

Link copied to clipboard
open operator override fun compareTo(other: Entity): Int

Compares entities on id.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open suspend fun fetchMember(guildId: Snowflake): Member

Retrieve the Member associated with this behaviour from the provided EntitySupplier

Link copied to clipboard
open suspend fun fetchMemberOrNull(guildId: Snowflake): Member?

Retrieve the Member associated with this behaviour from the provided EntitySupplier returns null if the Member isn't present.

Link copied to clipboard
open suspend fun fetchUser(): User

Retrieve the User associated with this behaviour from the provided EntitySupplier

Link copied to clipboard
open suspend fun fetchUserOrNull(): User?

Retrieve the User associated with this behaviour from the provided EntitySupplier returns null if the User isn't present.

Link copied to clipboard
open suspend fun getDmChannel(): DmChannel

Requests to get or create a DmChannel between this bot and the user.

Link copied to clipboard
open suspend fun getDmChannelOrNull(): DmChannel?

Requests to get or create a DmChannel between this bot and the user, returns null if the user does not allow DMs.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun User.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveUser
inline fun User.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveUser.() -> Unit): LiveUser
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun withStrategy(strategy: EntitySupplyStrategy<*>): User

Returns a new User with the given strategy.