Class EventHandler<T extends GenericInteractionCreateEvent>
java.lang.Object
io.github.kaktushose.jdac.dispatching.handling.EventHandler<T>
- All Implemented Interfaces:
BiConsumer<T,Runtime>
- Direct Known Subclasses:
AutoCompleteHandler, ComponentHandler, ContextCommandHandler, ModalHandler, SlashCommandHandler
@Internal
public abstract sealed class EventHandler<T extends GenericInteractionCreateEvent>
extends Object
implements BiConsumer<T,Runtime>
permits AutoCompleteHandler, ComponentHandler, ModalHandler, ContextCommandHandler, SlashCommandHandler
Implementations of this class are handling specific GenericInteractionCreateEvents.
Each EventHandler is split into 3 steps:
-
Preparation (
prepare(GenericInteractionCreateEvent, Runtime)): In this step theInvocationContextis created from the jda event and the involvedRuntime. -
Middleware execution: In this step all registered
Middlewares are executed ordered by theirPriority. -
Invocation (
invoke(InvocationContext, Runtime)): In this step the user implemented method is called with help of the rightInteractionDefinition
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TypeAdaptersprotected final FrameworkContextprotected final ErrorMessageFactoryprotected final InteractionRegistrystatic final ScopedValue<Boolean> static final org.slf4j.Loggerprotected final Middlewaresstatic final ScopedValue<RichInvocationContext> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiConsumer
andThen
-
Field Details
-
RICH_INVOCATION_CONTEXT
-
INVOCATION_PERMITTED
-
log
public static final org.slf4j.Logger log -
context
-
middlewares
-
interactionRegistry
-
adapterRegistry
-
errorMessageFactory
-
-
Constructor Details
-
EventHandler
-
-
Method Details
-
prepare
-
accept
- Specified by:
acceptin interfaceBiConsumer<T extends GenericInteractionCreateEvent, Runtime>
-