A - The actor typepublic final class Hooks<A extends CommandActor>
extends java.lang.Object
Hooks, which are listeners that
allow to execute code at certain points of the command flow.
Each Lamp instance maintains a Hooks registry,
which may be modified using Lamp.Builder#hooks().
Hook| Modifier and Type | Class and Description |
|---|---|
static class |
Hooks.Builder<A extends CommandActor>
A builder for
Hooks |
| Modifier and Type | Method and Description |
|---|---|
static <A extends CommandActor> |
builder()
Creates a new hooks
Hooks.Builder |
boolean |
onCommandExecuted(@NotNull ExecutableCommand<A> command,
@NotNull ExecutionContext<A> context)
Calls all
execution hooks. |
boolean |
onCommandRegistered(@NotNull ExecutableCommand<A> command)
Calls all
registration hooks. |
boolean |
onCommandUnregistered(@NotNull ExecutableCommand<A> command)
Calls all
un-registration hooks. |
@Contract(value="-> new",
pure=true)
@NotNull
public static <A extends CommandActor> Hooks.Builder<A> builder()
Hooks.BuilderA - The actor@ApiStatus.Internal
public boolean onCommandRegistered(@NotNull
@NotNull ExecutableCommand<A> command)
registration hooks.command - The command that was registered@ApiStatus.Internal
public boolean onCommandUnregistered(@NotNull
@NotNull ExecutableCommand<A> command)
un-registration hooks.command - The command that was unregistered@ApiStatus.Internal
public boolean onCommandExecuted(@NotNull
@NotNull ExecutableCommand<A> command,
@NotNull
@NotNull ExecutionContext<A> context)
execution hooks.command - The command that was executedcontext - The execution context