Class 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 java.util.function.Function<@NonNull C,​@NonNull java.lang.String> prefixMapper, @Nullable java.util.function.BiFunction<@NonNull C,​@NonNull java.lang.String,​@NonNull java.lang.Boolean> permissionMapper, @NonNull java.util.function.Function<cloud.commandframework.CommandTree<C>,​cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull java.util.function.Function<@NonNull JDACommandSender,​@NonNull C> commandSenderMapper, @NonNull java.util.function.Function<@NonNull C,​@NonNull JDACommandSender> backwardsCommandSenderMapper)
      Construct a new JDA Command Manager
    • Method Summary

      • Methods inherited from class cloud.commandframework.CommandManager

        argumentBuilder, command, command, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, executeCommand, flagBuilder, getCaptionRegistry, getCommandHelpHandler, getCommandRegistrationHandler, getCommands, getCommandSuggestionProcessor, getCommandSyntaxFormatter, getCommandTree, getExceptionHandler, getParserRegistry, getRegistrationState, getSetting, handleException, hasPermission, isCommandRegistrationAllowed, postprocessContext, preprocessContext, registerCommandPostProcessor, registerCommandPreProcessor, registerDefaultCaptions, registerExceptionHandler, requireState, 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 Detail

      • JDA4CommandManager

        public JDA4CommandManager​(@NonNull net.dv8tion.jda.api.JDA jda,
                                  @NonNull java.util.function.Function<@NonNull C,​@NonNull java.lang.String> prefixMapper,
                                  @Nullable java.util.function.BiFunction<@NonNull C,​@NonNull java.lang.String,​@NonNull java.lang.Boolean> permissionMapper,
                                  @NonNull java.util.function.Function<cloud.commandframework.CommandTree<C>,​cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator,
                                  @NonNull java.util.function.Function<@NonNull JDACommandSender,​@NonNull C> commandSenderMapper,
                                  @NonNull java.util.function.Function<@NonNull C,​@NonNull JDACommandSender> backwardsCommandSenderMapper)
                           throws java.lang.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:
        java.lang.InterruptedException - If the jda instance does not ready correctly