Role

data class Role(val data: RoleData, val kord: Kord, val supplier: EntitySupplier = kord.defaultSupplier) : RoleBehavior(source)

Constructors

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

Properties

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

The RoleFlags of this role.

Link copied to clipboard

The guild behavior 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
Link copied to clipboard
val icon: Asset?
Link copied to clipboard
Link copied to clipboard
open override val id: Snowflake

The unique identifier of this entity.

Link copied to clipboard
open override val kord: Kord

The kord instance that created this object.

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

The raw mention of this entity.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val supplier: EntitySupplier

The supplier used to request entities.

Link copied to clipboard

The tags of this role, if present.

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override 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 override 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 operator override fun equals(other: Any?): Boolean
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 hashCode(): Int
Link copied to clipboard
fun Role.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveRole
inline fun Role.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveRole.() -> Unit): LiveRole
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun withStrategy(strategy: EntitySupplyStrategy<*>): Role

Returns a new Role with the given strategy.