ComponentContainer
Class representing a single set of components that can be applied to any message.
A timeout is supported by this class. If a timeout is provided, the components stored within this container will be unregistered from the ComponentRegistry. If this container contains actionable components, the timeout will be reset whenever an actionable component is interacted with.
The startTimeoutNow parameter defaults to false, but will be set to true automatically if you're using a components DSL function provided in the message creation/modification builders. When this is true, the timeout task will be started immediately - when it's false, you'll have to call the timeoutTask start function yourself.
Parameters
Optional timeout duration.
Whether to start the timeout immediately.
Properties
Array containing sorted rows of components.
Extra callback to run when this container times out, if any.
If a timeout was provided, the scheduled timeout task will be stored here.
Components that haven't been sorted into rows by sort yet.
Functions
Apply the components in this container to a message that's being created or edited.
DSL function for creating a disabled button and adding it to the current ComponentContainer.
DSL function for creating an ephemeral button and adding it to the current ComponentContainer.
DSL function for creating an ephemeral button with modal, and adding it to the current ComponentContainer.
DSL function for creating an ephemeral channel select menu and adding it to the current ComponentContainer.
DSL function for creating an ephemeral mentionable select menu, and adding it to the current ComponentContainer.
DSL function for creating an ephemeral role select menu and adding it to the current ComponentContainer.
DSL function for creating an ephemeral string select menu and adding it to the current ComponentContainer.
DSL function for creating an ephemeral user select menu and adding it to the current ComponentContainer.
DSL function for creating a link button and adding it to the current ComponentContainer.
Register an additional callback to be run when this container times out, assuming a timeout is configured.
DSL function for creating a public button and adding it to the current ComponentContainer.
DSL function for creating a public button with modal, and adding it to the current ComponentContainer.
DSL function for creating a public channel select menu and adding it to the current ComponentContainer.
DSL function for creating a public mentionable select menu and adding it to the current ComponentContainer.
DSL function for creating a public role select menu and adding it to the current ComponentContainer.
DSL function for creating a public string select menu and adding it to the current ComponentContainer.
DSL function for creating a public user select menu and adding it to the current ComponentContainer.
Remove the given component, and unregister it from the ComponentRegistry.
Remove all components, and unregister them from the ComponentRegistry.
Given two components, replace the old component with the new one and likewise handle registration.
Given an old component ID and new component, replace the old component with the new one and likewise handle registration.
Sort all components in unsortedComponents by packing them into rows as tightly as possible.