Package-level declarations

Types

Link copied to clipboard

Abstract class representing a basic Discord component.

Link copied to clipboard
open class ComponentContainer(val timeout: Duration? = null, startTimeoutNow: Boolean = false) : KordExKoinComponent

Class representing a single set of components that can be applied to any message.

Link copied to clipboard
abstract class ComponentContext<E : ComponentInteractionCreateEvent>(val component: Component, val event: E, val cache: MutableStringKeyedMap<Any>) : KordExKoinComponent, TranslatableContext

Abstract class representing the execution context for a generic components.

Link copied to clipboard

Component registry, keeps track of components and handles incoming interaction events, dispatching as needed to registered component actions.

Link copied to clipboard
abstract class ComponentWithAction<E : ComponentInteractionCreateEvent, C : ComponentContext<*>, M : ModalForm>(val timeoutTask: Task?, val modal: () -> M? = null) : ComponentWithID, Lockable

Abstract class representing a component with both an ID and executable action.

Link copied to clipboard
abstract class ComponentWithID : Component

Abstract class representing a component with an ID, which defaults to a newly-generated UUID.

Properties

Link copied to clipboard
const val ROW_SIZE: Int = 5

The maximum number of slots you can have in a row.

Functions

Link copied to clipboard
suspend fun MessageBuilder.applyComponents(components: ComponentContainer)

Convenience function for applying the components in a ComponentContainer to a message you're creating.

Link copied to clipboard
suspend fun ComponentContainer(timeout: Duration? = null, startTimeoutNow: Boolean = false, builder: suspend ComponentContainer.() -> Unit): ComponentContainer

DSL-style factory function to make component containers these by hand easier.

Link copied to clipboard
suspend fun MessageBuilder.components(timeout: Duration? = null, builder: suspend ComponentContainer.() -> Unit): ComponentContainer

Convenience function for creating a ComponentContainer and components, and applying it to a message you're creating. Supply a timeout and the components you add will be removed from the registry after the given period of inactivity.

Link copied to clipboard

DSL function for creating a disabled button and adding it to the current ComponentContainer.

Link copied to clipboard

DSL function for creating an ephemeral button and adding it to the current ComponentContainer.

suspend fun <M : ModalForm> ComponentContainer.ephemeralButton(modal: () -> M?, row: Int? = null, builder: suspend EphemeralInteractionButton<M>.() -> Unit): EphemeralInteractionButton<M>

DSL function for creating an ephemeral button with modal, and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.ephemeralChannelSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend EphemeralChannelSelectMenu<M>.() -> Unit): EphemeralChannelSelectMenu<M>

DSL function for creating an ephemeral channel select menu and adding it to the current ComponentContainer.

Link copied to clipboard

DSL function for creating an ephemeral mentionable select menu, and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.ephemeralRoleSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend EphemeralRoleSelectMenu<M>.() -> Unit): EphemeralRoleSelectMenu<M>

DSL function for creating an ephemeral role select menu and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.ephemeralStringSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend EphemeralStringSelectMenu<M>.() -> Unit): EphemeralStringSelectMenu<M>

DSL function for creating an ephemeral string select menu and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.ephemeralUserSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend EphemeralUserSelectMenu<M>.() -> Unit): EphemeralUserSelectMenu<M>

DSL function for creating an ephemeral user select menu and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun ComponentContainer.linkButton(row: Int? = null, builder: suspend LinkInteractionButton.() -> Unit): LinkInteractionButton

DSL function for creating a link button and adding it to the current ComponentContainer.

Link copied to clipboard

DSL function for creating a public button and adding it to the current ComponentContainer.

suspend fun <M : ModalForm> ComponentContainer.publicButton(modal: () -> M?, row: Int? = null, builder: suspend PublicInteractionButton<M>.() -> Unit): PublicInteractionButton<M>

DSL function for creating a public button with modal, and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.publicChannelSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend PublicChannelSelectMenu<M>.() -> Unit): PublicChannelSelectMenu<M>

DSL function for creating a public channel select menu and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.publicMentionableSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend PublicMentionableSelectMenu<M>.() -> Unit): PublicMentionableSelectMenu<M>

DSL function for creating a public mentionable select menu and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.publicRoleSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend PublicRoleSelectMenu<M>.() -> Unit): PublicRoleSelectMenu<M>

DSL function for creating a public role select menu and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.publicStringSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend PublicStringSelectMenu<M>.() -> Unit): PublicStringSelectMenu<M>

DSL function for creating a public string select menu and adding it to the current ComponentContainer.

Link copied to clipboard
suspend fun <M : ModalForm> ComponentContainer.publicUserSelectMenu(modal: () -> M?, row: Int? = null, builder: suspend PublicUserSelectMenu<M>.() -> Unit): PublicUserSelectMenu<M>

DSL function for creating a public user select menu and adding it to the current ComponentContainer.