RoleBehavior

The behavior of a Discord Role associated to a guild.

Inheritors

Properties

Link copied to clipboard

The guild behavior 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

The raw mention of this entity.

Link copied to clipboard
abstract val supplier: EntitySupplier

The supplier used to request entities.

Functions

Link copied to clipboard
open suspend fun asRole(): Role

Requests to get the this behavior as a Role if it's not an instance of a Role.

Link copied to clipboard
open suspend fun asRoleOrNull(): Role?

Requests to get this behavior as a Role if its not an instance of a Role, returns null if the user isn't present.

Link copied to clipboard
open suspend fun changePosition(position: Int): Flow<Role>

Requests to change the position of this role.

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

Compares entities on id.

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

Requests to delete this role.

Link copied to clipboard
inline suspend fun RoleBehavior.edit(builder: RoleModifyBuilder.() -> Unit): Role

Requests to edit this role.

Link copied to clipboard
open suspend fun fetchRole(): Role

Retrieve the Role associated with this behaviour from the provided EntitySupplier

Link copied to clipboard
open suspend fun fetchRoleOrNull(): Role?

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

Link copied to clipboard
open suspend fun getPosition(): Int

Requests to get the position of this role in the role list of this guild.

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

Returns a new RoleBehavior with the given strategy.