Package dev.sympho.bot_utils.component
Interface ButtonManager.Handler
- All Superinterfaces:
ComponentManager.Handler<ButtonManager.HandlerFunction>
- Enclosing class:
- ButtonManager
@Immutable
public static interface ButtonManager.Handler
extends ComponentManager.Handler<ButtonManager.HandlerFunction>
Specification for the handling of a button.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe default builder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder.builder(ButtonManager.Handler base) Creates a new builder initialized with the properties of the given handler.default Groupgroup()The group that the user must have access to in order to use the button.default booleanmutex()Iftrue, then this handler will acquire a lock on the source message before executing.Methods inherited from interface dev.sympho.bot_utils.component.ComponentManager.Handler
handler, id
-
Method Details
-
group
The group that the user must have access to in order to use the button.Defaults to everyone (no restriction).
- Returns:
- The group.
-
mutex
@Default default boolean mutex()Iftrue, then this handler will acquire a lock on the source message before executing.In other words, for any given message, at any given time, there is at most one handler currently executing that was triggered by a button on that message and have this value as
true. If a mutex event occurs on a message while there is already one being handled, it will automatically fail and the user will be informed.Defaults to
false.- Returns:
- Whether the handler has mutually-exclusive execution.
-
builder
Creates a new builder.- Returns:
- The builder.
-
builder
Creates a new builder initialized with the properties of the given handler.- Parameters:
base- The base instance to copy.- Returns:
- The builder.
-