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
- Direct Known Subclasses:
JDA4CommandManager
Deprecated.
Command manager for use with JDA
-
Nested Class Summary
Nested classes/interfaces inherited from class cloud.commandframework.CommandManager
cloud.commandframework.CommandManager.ManagerSettings, cloud.commandframework.CommandManager.RegistrationState -
Constructor Summary
ConstructorsConstructorDescriptionJDACommandManager(@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 net.dv8tion.jda.api.events.message.MessageReceivedEvent,@NonNull C> commandSenderMapper, @NonNull Function<@NonNull C,@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent> backwardsCommandSenderMapper)Deprecated.Construct a new JDA Command Manager -
Method Summary
Modifier and TypeMethodDescription@NonNull cloud.commandframework.meta.CommandMetaDeprecated.Deprecated.Get the backwards command sender pluginlonggetBotId()Deprecated.Get the bots discord idDeprecated.Get the command sender mapper@NonNull net.dv8tion.jda.api.JDAgetJDA()Deprecated.Get the JDA instanceDeprecated.Get the prefix mapperbooleanhasPermission(@NonNull C sender, @NonNull String permission)Deprecated.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
-
Constructor Details
-
JDACommandManager
public JDACommandManager(@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 net.dv8tion.jda.api.events.message.MessageReceivedEvent,@NonNull C> commandSenderMapper, @NonNull Function<@NonNull C,@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent> backwardsCommandSenderMapper) throws InterruptedExceptionDeprecated.Construct 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- 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 betweenCommandExecutionCoordinator.simpleCoordinator()andAsynchronousCommandExecutionCoordinatorcommandSenderMapper- Function that mapsMessageReceivedEventto the command sender typebackwardsCommandSenderMapper- Function that maps the command sender type toMessageReceivedEvent- Throws:
InterruptedException- If the jda instance does not ready correctly
-
-
Method Details
-
getJDA
public final @NonNull net.dv8tion.jda.api.JDA getJDA()Deprecated.Get the JDA instance- Returns:
- JDA instance
-
getPrefixMapper
Deprecated.Get the prefix mapper- Returns:
- Prefix mapper
-
getCommandSenderMapper
public final @NonNull Function<@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent,@NonNull C> getCommandSenderMapper()Deprecated.Get the command sender mapper- Returns:
- Command sender mapper
-
getBackwardsCommandSenderMapper
public final @NonNull Function<@NonNull C,@NonNull net.dv8tion.jda.api.events.message.MessageReceivedEvent> getBackwardsCommandSenderMapper()Deprecated.Get the backwards command sender plugin- Returns:
- The backwards command sender mapper
-
getBotId
public final long getBotId()Deprecated.Get the bots discord id- Returns:
- Bots discord id
-
hasPermission
Deprecated.- Specified by:
hasPermissionin classcloud.commandframework.CommandManager<C>
-
createDefaultCommandMeta
public final @NonNull cloud.commandframework.meta.CommandMeta createDefaultCommandMeta()Deprecated.- Specified by:
createDefaultCommandMetain classcloud.commandframework.CommandManager<C>
-
JDA4CommandManager