Package cloud.commandframework.jda
Class JDA4CommandManager<C>
java.lang.Object
cloud.commandframework.CommandManager<C>
cloud.commandframework.jda.JDACommandManager<C>
cloud.commandframework.jda.JDA4CommandManager<C>
- Type Parameters:
C- Command sender type
Command manager for use with JDA 4
- Since:
- 1.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class cloud.commandframework.CommandManager
cloud.commandframework.CommandManager.ManagerSettings, cloud.commandframework.CommandManager.RegistrationState -
Constructor Summary
ConstructorsConstructorDescriptionJDA4CommandManager(@NonNull net.dv8tion.jda.api.JDA jda, @NonNull Function<@NonNull C, @NonNull String> prefixMapper, @Nullable BiFunction<@NonNull C, @NonNull String, @NonNull Boolean> permissionMapper, @NonNull Function<cloud.commandframework.CommandTree<C>, cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull Function<@NonNull JDACommandSender, @NonNull C> commandSenderMapper, @NonNull Function<@NonNull C, @NonNull JDACommandSender> backwardsCommandSenderMapper) Construct a new JDA Command Manager -
Method Summary
Methods inherited from class cloud.commandframework.jda.JDACommandManager
createDefaultCommandMeta, getBackwardsCommandSenderMapper, getBotId, getCommandSenderMapper, getJDA, getPrefixMapper, hasPermissionMethods inherited from class cloud.commandframework.CommandManager
argumentBuilder, command, command, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandExecutionCoordinator, executeCommand, flagBuilder, getCaptionRegistry, getCommandHelpHandler, getCommandHelpHandler, getCommandRegistrationHandler, getCommands, getCommandSuggestionProcessor, getCommandSyntaxFormatter, getCommandTree, getExceptionHandler, getParserRegistry, getRegistrationState, getSetting, handleException, hasPermission, isCommandRegistrationAllowed, lockRegistration, parameterInjectorRegistry, postprocessContext, preprocessContext, registerCommandPostProcessor, registerCommandPreProcessor, registerDefaultCaptions, registerExceptionHandler, requireState, setCaptionRegistry, setCommandRegistrationHandler, setCommandSuggestionProcessor, setCommandSyntaxFormatter, setSetting, suggest, transitionIfPossible, transitionOrThrow
-
Constructor Details
-
JDA4CommandManager
public JDA4CommandManager(@NonNull net.dv8tion.jda.api.JDA jda, @NonNull Function<@NonNull C, @NonNull String> prefixMapper, @Nullable BiFunction<@NonNull C, throws InterruptedException@NonNull String, @NonNull Boolean> permissionMapper, @NonNull Function<cloud.commandframework.CommandTree<C>, cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull Function<@NonNull JDACommandSender, @NonNull C> commandSenderMapper, @NonNull Function<@NonNull C, @NonNull JDACommandSender> backwardsCommandSenderMapper) Construct a new JDA Command Manager- Parameters:
jda- JDA instance to register againstprefixMapper- Function that maps the sender to a command prefix stringpermissionMapper- Function used to check if a command sender has the permission to execute a commandcommandExecutionCoordinator- Execution coordinator instance. The coordinator is in charge of executing incoming commands. Some considerations must be made when picking a suitable execution coordinator for your platform. For example, an entirely asynchronous coordinator is not suitable when the parsers used in that particular platform are not thread safe. If you have commands that perform blocking operations, however, it might not be a good idea to use a synchronous execution coordinator. In most cases you will want to pick betweenCommandExecutionCoordinator.simpleCoordinator()andAsynchronousCommandExecutionCoordinatorcommandSenderMapper- Function that mapsJDACommandSenderto the command sender typebackwardsCommandSenderMapper- Function that maps the command sender type toJDACommandSender- Throws:
InterruptedException- If the jda instance does not ready correctly
-