Components
This class lets you create smart components such as buttons, select menus, and groups.
Every component can either be persistent or ephemeral, all components can be configured to:
Be used once
Have timeouts, a default timeout can be configured, which can be overridden, or set by the
timeout
methods.Have handlers
Have constraints (checks before the button can be used)
Except component groups which can only have their timeout configured, their default timeouts are the same as components.
Persistent components
Kept after restart
Handlers are methods; they can have arguments passed to them
Timeouts are also methods, additionally, they will be rescheduled when the bot restarts
Ephemeral components
Are deleted once the bot restarts
Handlers are closures, they can capture objects, but you shouldn't capture JDA entities
Timeouts are also closures, but are not rescheduled when restarting
Component groups
If deleted, all contained components are deleted
If one of the contained components is deleted, then all of its subsequent groups are also deleted
Note: Component groups cannot contain components with timeouts, you will need to disable the timeout on the components.
See also
Functions
Creates a reference to a rate limiter previously declared by a RateLimitProvider, alongside a discriminator which differentiates this component from others under the same group.
Gets an existing reference to a ComponentRateLimitReference.