MemberBehavior

The behavior of a Discord Member.

Inheritors

Properties

Link copied to clipboard

The guild this channel is associated to.

Link copied to clipboard
abstract val guildId: Snowflake

The id of the guild this channel is associated to.

Link copied to clipboard
abstract val id: Snowflake

The unique identifier of this entity.

Link copied to clipboard
abstract val kord: Kord

The kord instance that created this object.

Link copied to clipboard
open val mention: String
Link copied to clipboard
abstract val supplier: EntitySupplier

The supplier used to request entities.

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 fun asMember(): Member

Requests to get the this behavior as a Member.

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(): Member?

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

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 fun asUser(): User

Requests to get the this behavior as a User.

Link copied to clipboard
open suspend 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 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
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 suspend fun kick(reason: String? = null)

Requests to kick this member from its guild.

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 withStrategy(strategy: EntitySupplyStrategy<*>): MemberBehavior

Returns a new MemberBehavior with the given strategy.