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:

  1. Preparation (prepare(GenericInteractionCreateEvent, Runtime)): In this step the InvocationContext is created from the jda event and the involved Runtime.

  2. Middleware execution: In this step all registered Middlewares are executed ordered by their Priority.

  3. Invocation (invoke(InvocationContext, Runtime)): In this step the user implemented method is called with help of the right InteractionDefinition