Class CooldownMiddleware
java.lang.Object
com.github.kaktushose.jda.commands.dispatching.middleware.impl.CooldownMiddleware
- All Implemented Interfaces:
Middleware
,Consumer<InvocationContext<?>>
A
Middleware
implementation that contains the business logic behind command cooldowns.
If the command isn't annotated with Cooldown
or more
formally if the SlashCommandDefinition
doesn't hold a SlashCommandDefinition.CooldownDefinition
or the delay of the
SlashCommandDefinition.CooldownDefinition
amounts to 0
this filter has no effect.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(@NotNull InvocationContext<?> context) Checks if an active cooldown for the givenSlashCommandDefinition
exists and will eventually cancel the context.
-
Constructor Details
-
CooldownMiddleware
-
-
Method Details
-
accept
Checks if an active cooldown for the givenSlashCommandDefinition
exists and will eventually cancel the context.- Specified by:
accept
in interfaceConsumer<InvocationContext<?>>
- Specified by:
accept
in interfaceMiddleware
- Parameters:
context
- theInvocationContext
to filter
-