Package io.github.daflamingfox
Class CmdHandlerBuilder
- java.lang.Object
-
- io.github.daflamingfox.CmdHandlerBuilder
-
public class CmdHandlerBuilder extends Object
The main handler class, this is the manager for starting all the backend garbage.- Author:
- Jeffrey Morris
-
-
Constructor Summary
Constructors Constructor Description CmdHandlerBuilder(org.javacord.api.DiscordApi api, String prefix)Creates a new CmdHandlerBuilder object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmdHandlerBuilderaddSlashCommand(String name, String description, List<org.javacord.api.interaction.SlashCommandOption> options, List<org.javacord.api.interaction.SlashCommandPermissions> permissions, org.javacord.api.entity.server.Server server, CmdExecutor executor)Adds a slash command to the handler.CmdHandlerBuilderaddTextCommand(String keyword, String[] keywordAliases, String description, String usage, CmdExecutor executor)Adds a text command to the handler.voidbuild()Builds the handler and activates all the commands.StringgetPrefix()ArrayList<SlashCmd>getSlashCommands()ArrayList<TxtCmd>getTextCommands()
-
-
-
Constructor Detail
-
CmdHandlerBuilder
public CmdHandlerBuilder(org.javacord.api.DiscordApi api, String prefix)Creates a new CmdHandlerBuilder object- Parameters:
api- the discord api of your botprefix- the prefix to use for text commands.
-
-
Method Detail
-
addTextCommand
public CmdHandlerBuilder addTextCommand(String keyword, String[] keywordAliases, String description, String usage, CmdExecutor executor)
Adds a text command to the handler. This command is not activated until you callbuild()- Parameters:
keyword- the keyword that triggers the commandkeywordAliases- aliases for the keyworddescription- the description of the commandusage- the usage of the commandexecutor- the command itself- Returns:
- this builder
-
addSlashCommand
public CmdHandlerBuilder addSlashCommand(String name, String description, List<org.javacord.api.interaction.SlashCommandOption> options, List<org.javacord.api.interaction.SlashCommandPermissions> permissions, org.javacord.api.entity.server.Server server, CmdExecutor executor)
Adds a slash command to the handler. This command is not activated until you callbuild()- Parameters:
name- the name of the commanddescription- the description of the commandoptions- the options of the commandpermissions- the permissions of the commandserver- the server the command is forexecutor- the command itself- Returns:
- this builder
-
build
public void build()
Builds the handler and activates all the commands.
-
getPrefix
public String getPrefix()
- Returns:
- the prefix that the command handler is looking for when activating text commands.
-
-