Role

data class Role(data: RoleData, kord: Kord, supplier: EntitySupplier) : RoleBehavior

Functions

asRole
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.
asRoleOrNull
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.
changePosition
Link copied to clipboard
open suspend fun changePosition(position: Int): Flow<Role>
Requests to change the position of this role.
compareTo
Link copied to clipboard
open operator override fun compareTo(other: Entity): Int
Compares entities on id.
delete
Link copied to clipboard
open suspend fun delete(reason: String? = null)
Requests to delete this role.
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
fetchRole
Link copied to clipboard
open suspend fun fetchRole(): Role
Retrieve the Role associated with this behaviour from the provided EntitySupplier
fetchRoleOrNull
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.
getPosition
Link copied to clipboard
open suspend fun getPosition(): Int
Requests to get the position of this role in the role list of this guild.
hashCode
Link copied to clipboard
open override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String
withStrategy
Link copied to clipboard
open override fun withStrategy(strategy: EntitySupplyStrategy<*>): Role
Returns a new Role with the given strategy.

Properties

color
Link copied to clipboard
val color: Color
data
Link copied to clipboard
val data: RoleData
guild
Link copied to clipboard
open val guild: GuildBehavior
The guild behavior this channel is associated to.
guildId
Link copied to clipboard
open override val guildId: Snowflake
The id of the guild this channel is associated to.
hoisted
Link copied to clipboard
val hoisted: Boolean
icon
Link copied to clipboard
val icon: Icon?
id
Link copied to clipboard
open override val id: Snowflake
The unique identifier of this entity.
kord
Link copied to clipboard
open override val kord: Kord
The kord instance that created this object.
managed
Link copied to clipboard
val managed: Boolean
mention
Link copied to clipboard
open val mention: String
The raw mention of this entity.
mentionable
Link copied to clipboard
val mentionable: Boolean
name
Link copied to clipboard
val name: String
permissions
Link copied to clipboard
val permissions: Permissions
rawPosition
Link copied to clipboard
val rawPosition: Int
supplier
Link copied to clipboard
open override val supplier: EntitySupplier
The supplier used to request entities.
tags
Link copied to clipboard
val tags: RoleTags?
The tags of this role, if present.
unicodeEmoji
Link copied to clipboard
val unicodeEmoji: String?

Extensions

live
Link copied to clipboard
@KordPreview()
fun Role.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveRole
@KordPreview()
inline fun Role.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveRole.() -> Unit): LiveRole

Sources

jvm source
Link copied to clipboard