Class JDACommandManager<C>

  • Type Parameters:
    C - Command sender type

    public class JDACommandManager<C>
    extends cloud.commandframework.CommandManager<C>
    Command manager for use with JDA
    • Nested Class Summary

      • Nested classes/interfaces inherited from class cloud.commandframework.CommandManager

        cloud.commandframework.CommandManager.ManagerSettings
    • Constructor Summary

      Constructors 
      Constructor Description
      JDACommandManager​(@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 net.dv8tion.jda.api.events.message.MessageReceivedEvent,​@NonNull C> commandSenderMapper, @NonNull java.util.function.Function<@NonNull C,​@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent> backwardsCommandSenderMapper)
      Construct a new JDA Command Manager
    • Method Summary

      Modifier and Type Method Description
      @NonNull cloud.commandframework.meta.CommandMeta createDefaultCommandMeta()  
      @NonNull java.util.function.Function<@NonNull C,​@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent> getBackwardsCommandSenderMapper()
      Get the backwards command sender plugin
      long getBotId()
      Get the bots discord id
      @NonNull java.util.function.Function<@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent,​@NonNull C> getCommandSenderMapper()
      Get the command sender mapper
      @NonNull net.dv8tion.jda.api.JDA getJDA()
      Get the JDA instance
      @NonNull java.util.function.Function<@NonNull C,​@NonNull java.lang.String> getPrefixMapper()
      Get the prefix mapper
      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, executeCommand, flagBuilder, getCaptionRegistry, getCommandHelpHandler, getCommandRegistrationHandler, getCommands, getCommandSuggestionProcessor, getCommandSyntaxFormatter, getCommandTree, getExceptionHandler, getParserRegistry, getSetting, handleException, hasPermission, postprocessContext, preprocessContext, registerCommandPostProcessor, registerCommandPreProcessor, registerDefaultCaptions, registerExceptionHandler, setCaptionRegistry, setCommandRegistrationHandler, setCommandSuggestionProcessor, setCommandSyntaxFormatter, setSetting, suggest
      • Methods inherited from class java.lang.Object

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

      • JDACommandManager

        public JDACommandManager​(@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 net.dv8tion.jda.api.events.message.MessageReceivedEvent,​@NonNull C> commandSenderMapper,
                                 @NonNull java.util.function.Function<@NonNull C,​@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent> 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 - Coordination provider
        commandSenderMapper - Function that maps MessageReceivedEvent to the command sender type
        backwardsCommandSenderMapper - Function that maps the command sender type to MessageReceivedEvent
        Throws:
        java.lang.InterruptedException - If the jda instance does not ready correctly
    • Method Detail

      • getJDA

        public final @NonNull net.dv8tion.jda.api.JDA getJDA()
        Get the JDA instance
        Returns:
        JDA instance
      • getPrefixMapper

        public final @NonNull java.util.function.Function<@NonNull C,​@NonNull java.lang.String> getPrefixMapper()
        Get the prefix mapper
        Returns:
        Prefix mapper
      • getCommandSenderMapper

        public final @NonNull java.util.function.Function<@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent,​@NonNull C> getCommandSenderMapper()
        Get the command sender mapper
        Returns:
        Command sender mapper
      • getBackwardsCommandSenderMapper

        public final @NonNull java.util.function.Function<@NonNull C,​@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent> getBackwardsCommandSenderMapper()
        Get the backwards command sender plugin
        Returns:
        The backwards command sender mapper
      • getBotId

        public final long getBotId()
        Get the bots discord id
        Returns:
        Bots discord id
      • 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.CommandMeta createDefaultCommandMeta()
        Specified by:
        createDefaultCommandMeta in class cloud.commandframework.CommandManager<C>