Category

class Category(val data: ChannelData, val kord: Kord, val supplier: EntitySupplier = kord.defaultSupplier) : TopGuildChannel, CategoryBehavior(source)

An instance of a Discord category associated to a guild.

Constructors

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

Properties

Link copied to clipboard

Requests to get the channels that belong to this Category.

Link copied to clipboard
open override val data: ChannelData
Link copied to clipboard
open val flags: ChannelFlags?

The flags of this channel, if present.

Link copied to clipboard
open override val guild: GuildBehavior

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
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
open val mention: String

This channel formatted as a mention as used by the Discord API.

Link copied to clipboard
open val name: String

The name of this channel.

Link copied to clipboard

The permission overwrites for this channel.

Link copied to clipboard
open val rawPosition: Int

The raw position of this channel in the guild as displayed by Discord.

Link copied to clipboard
open override val supplier: EntitySupplier

The supplier used to request entities.

Link copied to clipboard
open val type: ChannelType

The type of this channel.

Functions

Link copied to clipboard
open suspend fun addOverwrite(overwrite: PermissionOverwrite, reason: String? = null)

Requests to add or replace a PermissionOverwrite to this entity.

Link copied to clipboard
open suspend override fun asChannel(): Category

Requests to get this behavior as a Channel .

Link copied to clipboard
inline suspend fun <T : Channel> ChannelBehavior.asChannelOf(): T

Requests to get the Channel represented by this ChannelBehavior.

Link copied to clipboard
inline suspend fun <T : Channel> ChannelBehavior.asChannelOfOrNull(): T?

Requests to get the Channel represented by this ChannelBehavior, returns null if the Channel isn't present.

Link copied to clipboard
open suspend override fun asChannelOrNull(): Category

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

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

Compares entities on id.

Link copied to clipboard
inline suspend fun CategoryBehavior.createNewsChannel(name: String, builder: NewsChannelCreateBuilder.() -> Unit = {}): NewsChannel

Requests to create a new news channel with this category as parent.

Link copied to clipboard

Requests to create a new stage channel with this category as parent.

Link copied to clipboard
inline suspend fun CategoryBehavior.createTextChannel(name: String, builder: TextChannelCreateBuilder.() -> Unit = {}): TextChannel

Requests to create a new text channel with this category as parent.

Link copied to clipboard

Requests to create a new voice channel with this category as parent.

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

Requests to delete a channel (or close it if this is a dm channel).

Link copied to clipboard

Requests to edit this category.

Link copied to clipboard

Requests to add or replace a PermissionOverwrite for the memberId.

Link copied to clipboard

Requests to add or replace a PermissionOverwrite for the roleId.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open suspend fun fetchChannel(): Channel

Retrieve the Channel associated with this behaviour from the provided EntitySupplier

Link copied to clipboard
open suspend fun fetchChannelOrNull(): Channel?

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

Link copied to clipboard
open suspend fun getEffectivePermissions(memberId: Snowflake): Permissions

Calculates the effective permissions of the memberId in this channel, applying the overwrite for the member and their roles on top of the base permissions.

Link copied to clipboard
open suspend fun getGuild(): Guild

Requests to get this channel's Guild.

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

Requests to get this channel's Guild, returns null if the guild isn't present.

Link copied to clipboard

Gets the permission overwrite for the memberId in this channel, if present.

Link copied to clipboard

Gets the permission overwrite for the roleId in this channel, if present.

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

Requests to get the position of this channel in the guild, as displayed in Discord.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun Category.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveCategory
fun Channel.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveChannel
fun TopGuildChannel.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveGuildChannel
inline fun Category.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveCategory.() -> Unit): LiveCategory
inline fun Channel.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveChannel.() -> Unit): LiveChannel
inline fun TopGuildChannel.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job), block: LiveGuildChannel.() -> Unit): LiveGuildChannel
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun withStrategy(strategy: EntitySupplyStrategy<*>): Category

Returns a new Category with the given strategy.