Package cloud.commandframework.jda
Class JDACommandManager<C>
- java.lang.Object
-
- cloud.commandframework.CommandManager<C>
-
- cloud.commandframework.jda.JDACommandManager<C>
-
- Type Parameters:
C- Command sender type
public class JDACommandManager<C> extends cloud.commandframework.CommandManager<C>Command manager for use with JDA
-
-
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.CommandMetacreateDefaultCommandMeta()@NonNull java.util.function.Function<@NonNull C,@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent>getBackwardsCommandSenderMapper()Get the backwards command sender pluginlonggetBotId()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.JDAgetJDA()Get the JDA instance@NonNull java.util.function.Function<@NonNull C,@NonNull java.lang.String>getPrefixMapper()Get the prefix mapperbooleanhasPermission(@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
-
-
-
-
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.InterruptedExceptionConstruct 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- Coordination providercommandSenderMapper- Function that mapsMessageReceivedEventto the command sender typebackwardsCommandSenderMapper- Function that maps the command sender type toMessageReceivedEvent- 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:
hasPermissionin classcloud.commandframework.CommandManager<C>
-
createDefaultCommandMeta
public final @NonNull cloud.commandframework.meta.CommandMeta createDefaultCommandMeta()
- Specified by:
createDefaultCommandMetain classcloud.commandframework.CommandManager<C>
-
-