Class JavacordCommandManager<C>


  • public class JavacordCommandManager<C>
    extends cloud.commandframework.CommandManager<C>
    • 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
      JavacordCommandManager​(@NonNull org.javacord.api.DiscordApi discordApi, @NonNull java.util.function.Function<@NonNull cloud.commandframework.CommandTree<C>,​@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull java.util.function.Function<@NonNull JavacordCommandSender,​@NonNull C> commandSenderMapper, @NonNull java.util.function.Function<@NonNull C,​@NonNull JavacordCommandSender> backwardsCommandSenderMapper, @NonNull java.util.function.Function<@NonNull C,​@NonNull java.lang.String> commandPrefixMapper, @Nullable java.util.function.BiFunction<@NonNull C,​@NonNull java.lang.String,​@NonNull java.lang.Boolean> commandPermissionMapper)
      Construct a new Javacord command manager
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NonNull cloud.commandframework.meta.SimpleCommandMeta createDefaultCommandMeta()  
      @NonNull java.lang.String getCommandPrefix​(@NonNull C sender)
      Gets the current command prefix
      @NonNull org.javacord.api.DiscordApi getDiscordApi()
      Gets the DiscordApi instance
      boolean hasPermission​(@NonNull C sender, @NonNull java.lang.String permission)  
      • Methods inherited from class cloud.commandframework.CommandManager

        argumentBuilder, command, command, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, 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
      • Methods inherited from class java.lang.Object

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

      • JavacordCommandManager

        public JavacordCommandManager​(@NonNull org.javacord.api.DiscordApi discordApi,
                                      @NonNull java.util.function.Function<@NonNull cloud.commandframework.CommandTree<C>,​@NonNull cloud.commandframework.execution.CommandExecutionCoordinator<C>> commandExecutionCoordinator,
                                      @NonNull java.util.function.Function<@NonNull JavacordCommandSender,​@NonNull C> commandSenderMapper,
                                      @NonNull java.util.function.Function<@NonNull C,​@NonNull JavacordCommandSender> backwardsCommandSenderMapper,
                                      @NonNull java.util.function.Function<@NonNull C,​@NonNull java.lang.String> commandPrefixMapper,
                                      @Nullable java.util.function.BiFunction<@NonNull C,​@NonNull java.lang.String,​@NonNull java.lang.Boolean> commandPermissionMapper)
        Construct a new Javacord command manager
        Parameters:
        discordApi - Instance of DiscordApi used to register listeners
        commandExecutionCoordinator - Coordinator provider
        commandSenderMapper - Function that maps Object to the command sender type
        backwardsCommandSenderMapper - Function that maps the command sender type to Object
        commandPrefixMapper - Function that maps the command sender type to the command prefix
        commandPermissionMapper - Function used to check if a command sender has the permission to execute a command
    • Method Detail

      • hasPermission

        public final boolean hasPermission​(@NonNull C sender,
                                           @NonNull java.lang.String permission)
        Specified by:
        hasPermission in class cloud.commandframework.CommandManager<C>
      • createDefaultCommandMeta

        public final @NonNull cloud.commandframework.meta.SimpleCommandMeta createDefaultCommandMeta()
        Specified by:
        createDefaultCommandMeta in class cloud.commandframework.CommandManager<C>
      • getCommandPrefix

        public @NonNull java.lang.String getCommandPrefix​(@NonNull C sender)
        Gets the current command prefix
        Parameters:
        sender - Sender used to get the prefix (probably won't used anyways)
        Returns:
        the command prefix
      • getDiscordApi

        public @NonNull org.javacord.api.DiscordApi getDiscordApi()
        Gets the DiscordApi instance
        Returns:
        Current DiscordApi instance