Interface ComponentManager.HandlerFunction<C extends @NonNull ComponentEventContext>

Type Parameters:
C - The context type.
All Superinterfaces:
BiFunction<C,String,Mono<?>>
All Known Subinterfaces:
ButtonManager.HandlerFunction, ModalManager.HandlerFunction
Enclosing class:
ComponentManager<E extends @NonNull ComponentInteractionEvent,C extends @NonNull ComponentEventContext,HF extends @NonNull ComponentManager.HandlerFunction<C>,H extends @NonNull ComponentManager.Handler<HF>>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface protected static interface ComponentManager.HandlerFunction<C extends @NonNull ComponentEventContext> extends BiFunction<C,String,Mono<?>>
A function used to handle an interaction event.
Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Mono<?>
    apply(C context, String args)
    Handles an interaction event.

    Methods inherited from interface java.util.function.BiFunction

    andThen
  • Method Details

    • apply

      Mono<?> apply(C context, String args)
      Handles an interaction event.
      Specified by:
      apply in interface BiFunction<C extends @NonNull ComponentEventContext,String,Mono<?>>
      Parameters:
      context - The interaction context.
      args - The argument string encoded in the components's custom ID. May be empty.
      Returns:
      A Mono that completes once handling is completed. It may result in an AccessException error to indicate that the user does not have access to perform this interaction.