Member

class Member(val memberData: MemberData, userData: UserData, val kord: Kord, val supplier: EntitySupplier = kord.defaultSupplier) : User, MemberBehavior(source)

An instance of a Discord Member.

Constructors

Link copied to clipboard
constructor(memberData: MemberData, userData: 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

The Instant until the user's timeout expires, or null if the user does not have a timeout.

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 member's effective name, prioritizing nickname over globalName and username.

Link copied to clipboard

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

Link copied to clipboard

The GuildMemberFlags of this member.

Link copied to clipboard

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

Link copied to clipboard

The guild this channel is associated to.

Link copied to clipboard
open override val guildId: Snowflake

The id of the guild this channel is associated to.

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

Whether the user has not yet passed the guild's Membership Screening requirements.

Link copied to clipboard

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

Link copied to clipboard

When the user joined this guild.

Link copied to clipboard
open override val kord: Kord

The kord instance that created this object.

Link copied to clipboard

The guild avatar of this member as an Asset.

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

The guild-specific nickname of the user, if present.

Link copied to clipboard

The total Permissions of this member in the channel an interaction was sent from.

Link copied to clipboard

When the user used their Nitro boost on the server.

Link copied to clipboard

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

Link copied to clipboard

The behaviors of the roles that apply to this user.

Link copied to clipboard

The ids of the roles that apply to this user.

Link copied to clipboard

The roles that apply to this user.

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 addRole(roleId: Snowflake, reason: String? = null)

Requests to add the Role with the roleId to this member.

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

Requests to get the this behavior as a Member.

open suspend override 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 override fun asMemberOrNull(): Member

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

open suspend override 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
inline suspend fun MemberBehavior.ban(builder: BanCreateBuilder.() -> Unit = {})

Requests to ban this member.

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

Compares entities on id.

Link copied to clipboard
inline suspend fun MemberBehavior.edit(builder: MemberModifyBuilder.() -> Unit): Member

Requests to edit this member.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open suspend fun fetchMember(): Member
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(): Member?
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 suspend fun getGuild(): Guild

Requests to get the Guild this member is part of.

Link copied to clipboard
open suspend fun getGuildOrNull(): Guild?

Requests to get the Guild this member is part of, returns null if the Guild isn't present.

Link copied to clipboard

Requests to calculate a summation of the permissions of this member's roles.

Link copied to clipboard
open suspend fun getPresence(): Presence

Requests to get the Presence of this member in the guild.

Link copied to clipboard
open suspend fun getPresenceOrNull(): Presence?

Requests to get the Presence of this member in the guild, returns null if the Presence isn't present.

Link copied to clipboard
open suspend fun getVoiceState(): VoiceState

Requests to get the VoiceState of this member in the guild.

Link copied to clipboard
open suspend fun getVoiceStateOrNull(): VoiceState?

Requests to get the VoiceState of this member in the guild, returns null if the VoiceState isn't present.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
suspend fun isOwner(): Boolean

Whether this member's id equals the Guild.ownerId.

Link copied to clipboard
open suspend fun kick(reason: String? = null)

Requests to kick this member from its guild.

Link copied to clipboard
fun Member.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveMember
fun User.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveUser
inline fun Member.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveMember.() -> Unit): LiveMember
inline fun User.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveUser.() -> Unit): LiveUser
Link copied to clipboard
open suspend fun removeRole(roleId: Snowflake, reason: String? = null)

Requests to remove the Role with the roleId from this member.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun withStrategy(strategy: EntitySupplyStrategy<*>): Member

Returns a new Member with the given strategy.