Properties

Link copied to clipboard

Returns all active public and private threads in the channel. Threads are ordered by their id, in descending order.

Link copied to clipboard

The category behavior this channel belongs to, if any.

Link copied to clipboard

The id of the category this channel belongs to, if any.

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

The flags of this channel, if present.

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

Requests to get the invites of this channel.

Link copied to clipboard
abstract 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
abstract val supplier: EntitySupplier

The supplier used to request entities.

Link copied to clipboard
open val type: ChannelType

The type of this channel.

Link copied to clipboard
open val webhooks: Flow<Webhook>

Requests to get all webhooks for 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(): ThreadParentChannel

Requests to get this behavior as a CategorizableChannel.

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

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

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

Compares entities on id.

Link copied to clipboard

Request to create an InviteWithMetadata for this channel.

Link copied to clipboard
inline suspend fun CategorizableChannelBehavior.createWebhook(name: String, builder: WebhookCreateBuilder.() -> Unit = {}): Webhook

Requests to create a new webhook configured by the builder.

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 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 suspend override fun fetchChannel(): ThreadParentChannel

Retrieve the ThreadParentChannel associated with this behaviour from the provided EntitySupplier

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

Retrieve the ThreadParentChannel associated with this behaviour from the provided EntitySupplier returns null if the ThreadParentChannel 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 fun getPublicArchivedThreads(before: Instant? = null, limit: Int? = null): Flow<ThreadChannel>

Returns archived threads in the channel that are public. Threads are ordered by ThreadChannel.archiveTimestamp in descending order. Requires the Read Message History Permission

Link copied to clipboard
fun Channel.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveChannel
fun TopGuildChannel.live(coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)): LiveGuildChannel
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
abstract override fun withStrategy(strategy: EntitySupplyStrategy<*>): ThreadParentChannel

Returns a new CategorizableChannelBehavior with the given strategy.