Interface ConfirmationConfiguration<C>

Type Parameters:
C - command sender type
All Known Implementing Classes:
ImmutableConfirmationConfiguration

@Immutable @API(status=STABLE, since="1.0.0") public interface ConfirmationConfiguration<C>
Configuration for a ConfirmationManager.
Since:
1.0.0
  • Method Details

    • builder

      Returns a new configuration builder.
      Type Parameters:
      C - command sender type
      Returns:
      the builder
    • cache

      Returns the cache used to store pending commands.
      Returns:
      the cache
    • noPendingCommandNotifier

      @NonNull Consumer<C> noPendingCommandNotifier()
      Returns a consumer that gets invoked when a sender tries to invoke the confirmation handler without having any pending commands.
      Returns:
      notifier for no pending commands
    • confirmationRequiredNotifier

      @NonNull BiConsumer<C,ConfirmationContext<C>> confirmationRequiredNotifier()
      Returns a consumer that gets invoked when a command requires confirmation.
      Returns:
      notifier for commands that require confirmation
    • bypassConfirmation

      default @NonNull Predicate<@NonNull CommandContext<C>> bypassConfirmation()
      Returns a predicate that determines whether the CommandContext should bypass the confirmation requirement.

      The default implementation always returns false

      Returns:
      predicate that determines whether confirmation should be skipped
    • expiration

      default @Nullable Duration expiration()
      Returns the time to keep the pending commands for. This can be set to null to not enforce an expiration time.

      It is recommended to configure the cache() to match this value.

      The default value is null.

      Returns:
      the expiration duration