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

public class JDA4CommandManager<C> extends JDACommandManager<C>
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

    Constructors
    Constructor
    Description
    JDA4CommandManager(@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.CommandManager

    argumentBuilder, capabilities, captionRegistry, captionRegistry, captionVariableReplacementHandler, captionVariableReplacementHandler, command, command, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandExecutionCoordinator, commandRegistrationHandler, commandRegistrationHandler, commands, commandSuggestionProcessor, commandSuggestionProcessor, commandSyntaxFormatter, commandSyntaxFormatter, commandTree, createCommandHelpHandler, createCommandHelpHandler, deleteRootCommand, executeCommand, flagBuilder, getCaptionRegistry, getCommandHelpHandler, getCommandHelpHandler, getCommandRegistrationHandler, getCommands, getCommandSuggestionProcessor, getCommandSyntaxFormatter, getCommandTree, getExceptionHandler, getParserRegistry, getRegistrationState, getSetting, handleException, hasCapability, hasPermission, isCommandRegistrationAllowed, lockRegistration, parameterInjectorRegistry, parserRegistry, postprocessContext, preprocessContext, registerCapability, registerCommandPostProcessor, registerCommandPreProcessor, registerDefaultCaptions, registerExceptionHandler, registrationState, requireState, rootCommands, setCaptionRegistry, setCommandRegistrationHandler, setCommandSuggestionProcessor, setCommandSyntaxFormatter, setSetting, suggest, transitionIfPossible, transitionOrThrow

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JDA4CommandManager

      public JDA4CommandManager(@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) throws InterruptedException
      Construct a new JDA Command Manager
      Parameters:
      jda - JDA instance to register against
      prefixMapper - Function that maps the sender to a command prefix string
      permissionMapper - Function used to check if a command sender has the permission to execute a command
      commandExecutionCoordinator - 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 between CommandExecutionCoordinator.simpleCoordinator() and AsynchronousCommandExecutionCoordinator
      commandSenderMapper - Function that maps JDACommandSender to the command sender type
      backwardsCommandSenderMapper - Function that maps the command sender type to JDACommandSender
      Throws:
      InterruptedException - If the jda instance does not ready correctly