Interface Handlers
- All Known Subinterfaces:
InteractionHandlers,MessageHandlers,SlashHandlers,TextHandlers
- All Known Implementing Classes:
InteractionHandlers.Impl,MessageHandlers.Impl,SlashHandlers.Impl,TextHandlers.Impl
A set of handlers for executing an invocation of a command.
Note that the implemented subinterfaces of this type determine what kinds of commands are
supported; if the handlers are specified through a MessageHandlers, the command will
only support invocations through messages, even if the invocation handler actually supports
slash commands. Implementing more than one is allowed, however, and some joint-type interfaces
are provided for convenience.
All instances of this class, as well as any contained collections, should be unmodifiable.
- Since:
- 1.0
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final InvocationHandler<CommandContext>An invocation handler that simply signals that handling should continue. -
Method Summary
Modifier and TypeMethodDescriptionstatic InteractionHandlersinteraction(InvocationHandler<? super InteractionCommandContext> invocation) Creates a handler set with the given handlers, with support only for interaction-based commands, and no result handlers.static InteractionHandlersinteraction(InvocationHandler<? super InteractionCommandContext> invocation, ResultHandler<? super InteractionCommandContext>... result) Creates a handler set with the given handlers, with support for interaction-based commands.static InteractionHandlersinteraction(InvocationHandler<? super InteractionCommandContext> invocation, List<? extends ResultHandler<? super InteractionCommandContext>> result) Creates a handler set with the given handlers, with support for interaction-based commands.The handler to use for executing the invocation.static MessageHandlersmessage(InvocationHandler<? super MessageCommandContext> invocation) Creates a handler set with the given handlers, with support only for message-based commands, and no result handlers.static MessageHandlersmessage(InvocationHandler<? super MessageCommandContext> invocation, ResultHandler<? super MessageCommandContext>... result) Creates a handler set with the given handlers, with support only for message-based commands.static MessageHandlersmessage(InvocationHandler<? super MessageCommandContext> invocation, List<? extends ResultHandler<? super MessageCommandContext>> result) Creates a handler set with the given handlers, with support only for message-based commands.List<? extends ResultHandler<?>>result()The handlers to use to handle the result (in the order given).static SlashHandlersslash(InvocationHandler<? super SlashCommandContext> invocation) Creates a handler set with the given handlers, with support only for slash-based commands, and no result handlers.static SlashHandlersslash(InvocationHandler<? super SlashCommandContext> invocation, ResultHandler<? super SlashCommandContext>... result) Creates a handler set with the given handlers, with support only for slash-based commands.static SlashHandlersslash(InvocationHandler<? super SlashCommandContext> invocation, List<? extends ResultHandler<? super SlashCommandContext>> result) Creates a handler set with the given handlers, with support only for slash-based commands.static TextHandlerstext(InvocationHandler<CommandContext> invocation) Creates a handler set with the given handlers, with support only for text-based commands, and no result handlers.static TextHandlerstext(InvocationHandler<CommandContext> invocation, ResultHandler<CommandContext>... result) Creates a handler set with the given handlers, with support for text-based commands.static TextHandlerstext(InvocationHandler<CommandContext> invocation, List<? extends ResultHandler<CommandContext>> result) Creates a handler set with the given handlers, with support for text-based commands.
-
Field Details
-
CONTINUE
An invocation handler that simply signals that handling should continue.
-
-
Method Details
-
invocation
The handler to use for executing the invocation.- Returns:
- The handler.
-
result
The handlers to use to handle the result (in the order given).- Returns:
- The handlers.
-
message
static MessageHandlers message(InvocationHandler<? super MessageCommandContext> invocation, List<? extends ResultHandler<? super MessageCommandContext>> result) Creates a handler set with the given handlers, with support only for message-based commands.- Parameters:
invocation- The invocation handler.result- The result handlers.- Returns:
- The handler set.
-
message
@SafeVarargs static MessageHandlers message(InvocationHandler<? super MessageCommandContext> invocation, ResultHandler<? super MessageCommandContext>... result) Creates a handler set with the given handlers, with support only for message-based commands.- Parameters:
invocation- The invocation handler.result- The result handlers.- Returns:
- The handler set.
-
message
Creates a handler set with the given handlers, with support only for message-based commands, and no result handlers.- Parameters:
invocation- The invocation handler.- Returns:
- The handler set.
-
slash
static SlashHandlers slash(InvocationHandler<? super SlashCommandContext> invocation, List<? extends ResultHandler<? super SlashCommandContext>> result) Creates a handler set with the given handlers, with support only for slash-based commands.- Parameters:
invocation- The invocation handler.result- The result handlers.- Returns:
- The handler set.
-
slash
@SafeVarargs static SlashHandlers slash(InvocationHandler<? super SlashCommandContext> invocation, ResultHandler<? super SlashCommandContext>... result) Creates a handler set with the given handlers, with support only for slash-based commands.- Parameters:
invocation- The invocation handler.result- The result handlers.- Returns:
- The handler set.
-
slash
Creates a handler set with the given handlers, with support only for slash-based commands, and no result handlers.- Parameters:
invocation- The invocation handler.- Returns:
- The handler set.
-
interaction
static InteractionHandlers interaction(InvocationHandler<? super InteractionCommandContext> invocation, List<? extends ResultHandler<? super InteractionCommandContext>> result) Creates a handler set with the given handlers, with support for interaction-based commands.- Parameters:
invocation- The invocation handler.result- The result handlers.- Returns:
- The handler set.
-
interaction
@SafeVarargs static InteractionHandlers interaction(InvocationHandler<? super InteractionCommandContext> invocation, ResultHandler<? super InteractionCommandContext>... result) Creates a handler set with the given handlers, with support for interaction-based commands.- Parameters:
invocation- The invocation handler.result- The result handlers.- Returns:
- The handler set.
-
interaction
static InteractionHandlers interaction(InvocationHandler<? super InteractionCommandContext> invocation) Creates a handler set with the given handlers, with support only for interaction-based commands, and no result handlers.- Parameters:
invocation- The invocation handler.- Returns:
- The handler set.
-
text
static TextHandlers text(InvocationHandler<CommandContext> invocation, List<? extends ResultHandler<CommandContext>> result) Creates a handler set with the given handlers, with support for text-based commands.- Parameters:
invocation- The invocation handler.result- The result handlers.- Returns:
- The handler set.
-
text
@SafeVarargs static TextHandlers text(InvocationHandler<CommandContext> invocation, ResultHandler<CommandContext>... result) Creates a handler set with the given handlers, with support for text-based commands.- Parameters:
invocation- The invocation handler.result- The result handlers.- Returns:
- The handler set.
-
text
Creates a handler set with the given handlers, with support only for text-based commands, and no result handlers.- Parameters:
invocation- The invocation handler.- Returns:
- The handler set.
-