public final class CommandHandlerBuilder
extends java.lang.Object
| Constructor and Description |
|---|
CommandHandlerBuilder()
Creates fluent configuration object for CommandHandler instance creation.
Equivalent of CommandHandlerBuilder(boolean) with parameter true. |
CommandHandlerBuilder(boolean createConfigIfAbsent)
Creates fluent configuration object for CommandHandler instance creation.
The single parameter determines whether a configuration file should be created in root directory. |
| Modifier and Type | Method and Description |
|---|---|
CommandHandler |
build() |
CommandHandlerBuilder |
cleanDbOnStartup(boolean cleanDbOnStartup)
Setting to false will prevent outdated cooldown entries from being deleted from the DB.
|
CommandHandlerBuilder |
disableCommandList()
Disables internal Command List command.
|
CommandHandlerBuilder |
disableInspectCommand()
Disables internal Inspect Command command.
|
CommandHandlerBuilder |
setCommandListEmbedColor(java.awt.Color helpColor) |
CommandHandlerBuilder |
setCommandPrefix(java.lang.String commandsPrefix)
Default prefix is ~
|
CommandHandlerBuilder |
setErrorEmbedColor(java.awt.Color errorColor) |
CommandHandlerBuilder |
setExecutorService(java.util.concurrent.ExecutorService executor)
A thread pool with size of available processors amount is used by default.
|
CommandHandlerBuilder |
setInspectCommandEmbedColor(java.awt.Color inspectColor) |
CommandHandlerBuilder |
setJda(net.dv8tion.jda.api.JDA jda) |
public CommandHandlerBuilder()
CommandHandlerBuilder(boolean) with parameter true. A configuration file will be created
in root directory, to prevent the file creation use CommandHandlerBuilder(boolean) with parameter
false. CommandHandler's parameters from the configuration are overridden by parameters set using methods of
the CommandHandlerBuilder.build() to create CommandHandler instance, JDA should be set using
setJda(JDA) Color.yellowColor.yellowColor.redpublic CommandHandlerBuilder(boolean createConfigIfAbsent)
CommandHandlerBuilder.build() to create CommandHandler instance, JDA should be set using
setJda(JDA) Color.yellowColor.yellowColor.redpublic CommandHandlerBuilder setJda(net.dv8tion.jda.api.JDA jda)
jda - the JDA the CommandHandler will be handling messages from.CommandHandlerBuilder. Useful for chainingpublic CommandHandlerBuilder cleanDbOnStartup(boolean cleanDbOnStartup)
CommandHandlerBuilder. Useful for chainingpublic CommandHandlerBuilder setExecutorService(java.util.concurrent.ExecutorService executor)
executor - the executor will be used for commands processing.CommandHandlerBuilder. Useful for chainingpublic CommandHandlerBuilder setCommandPrefix(java.lang.String commandsPrefix)
commandsPrefix - the prefix will be used to detect command call.CommandHandlerBuilder. Useful for chainingpublic CommandHandlerBuilder setCommandListEmbedColor(java.awt.Color helpColor)
helpColor - the color will be used for Command List's embed (the color to left of a message).CommandHandlerBuilder. Useful for chainingpublic CommandHandlerBuilder setErrorEmbedColor(java.awt.Color errorColor)
errorColor - the color will be used for error embed (the color to left of a message).CommandHandlerBuilder. Useful for chainingpublic CommandHandlerBuilder setInspectCommandEmbedColor(java.awt.Color inspectColor)
inspectColor - the color will be used for Inspect Command's embed (the color to left of a message).CommandHandlerBuilder. Useful for chainingpublic CommandHandlerBuilder disableCommandList()
CommandHandlerBuilder. Useful for chainingpublic CommandHandlerBuilder disableInspectCommand()
CommandHandlerBuilder. Useful for chainingpublic CommandHandler build()
CommandHandler instance with the given configuration