Package xyz.dynxsty.dih4jda.config
Class DIH4JDAConfig
java.lang.Object
xyz.dynxsty.dih4jda.config.DIH4JDAConfig
Simple data class which represents
DIH4JDA's configuration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Gets the packages where the commands are.
Standard:new String[]{}net.dv8tion.jda.api.JDAgetJDA()Gets you theJDAinstance thatDIH4JDAuses.booleanTrue if the stacktrace should be printed on anDIH4JDAThrowableEventif noDIH4JDAEventListeneris registered.
Standard:truebooleanTrue if unknown commands should be deleted or not.
Standard:truebooleanbooleanbooleanTrue if all commands should be registered on JDAsReadyEvent.
Standard:truebooleanTrue if theCommandNotRegisteredExceptionshould be thrown or not.voidsetBlockedLogTypes(DIH4JDALogger.Type[] blockedLogTypes) Sets one or moreDIH4JDALogger.Types that should not be getting logged.voidsetCommandPackages(String... commandsPackage) Sets one or more packages.voidsetDefaultPrintStacktrace(boolean defaultPrintStacktrace) True if the stacktrace should be printed on anDIH4JDAThrowableEventif noDIH4JDAEventListeneris registered.voidsetDeleteUnknownCommands(boolean deleteUnknownCommands) True if unknown commands should be deleted and false if not.voidsetExecutor(Executor executor) Sets a newExecutor.voidsetGlobalSmartQueue(boolean globalSmartQueue) True ifSmartQueueis enabled for global commands.voidsetGuildSmartQueue(boolean guildSmartQueue) True ifSmartQueueis enabled for guild only commands.voidsetJDA(net.dv8tion.jda.api.JDA jda) Sets theJDAinstance thatDIH4JDAshould use.voidsetRegisterOnReady(boolean registerOnReady) True if all commands should be registered on JDAsReadyEvent.voidsetThrowUnregisteredException(boolean throwUnregisteredException) True if theCommandNotRegisteredExceptionshould be thrown or not.
-
Constructor Details
-
DIH4JDAConfig
public DIH4JDAConfig()Creates a default instance.
-
-
Method Details
-
getJDA
public net.dv8tion.jda.api.JDA getJDA()Gets you theJDAinstance thatDIH4JDAuses.- Returns:
- the
JDAinstance.
-
setJDA
public void setJDA(net.dv8tion.jda.api.JDA jda) Sets theJDAinstance thatDIH4JDAshould use.- Parameters:
jda- theJDAinstance to use.
-
getCommandPackages
Gets the packages where the commands are.
Standard:new String[]{}- Returns:
- the package names as an
Stringarray
-
setCommandPackages
Sets one or more packages.- Parameters:
commandsPackage- the packages where the commands are located.
-
getBlockedLogTypes
- Returns:
- the
DIH4JDALogger.Types as an array.
-
setBlockedLogTypes
Sets one or moreDIH4JDALogger.Types that should not be getting logged.- Parameters:
blockedLogTypes- theDIH4JDALogger.Typeto block.
-
isRegisterOnReady
public boolean isRegisterOnReady()True if all commands should be registered on JDAsReadyEvent.
Standard:true- Returns:
- true if they are getting registered, otherwise false.
-
setRegisterOnReady
public void setRegisterOnReady(boolean registerOnReady) True if all commands should be registered on JDAsReadyEvent.- Parameters:
registerOnReady- true if they should be getting registered, otherwise false.
-
isGlobalSmartQueue
public boolean isGlobalSmartQueue()- Returns:
- true if it is enabled, otherwise false.
-
setGlobalSmartQueue
public void setGlobalSmartQueue(boolean globalSmartQueue) True ifSmartQueueis enabled for global commands.- Parameters:
globalSmartQueue- true if it should be enabled, otherwise false.
-
isGuildSmartQueue
public boolean isGuildSmartQueue()- Returns:
- true if it is enabled, otherwise false.
-
setGuildSmartQueue
public void setGuildSmartQueue(boolean guildSmartQueue) True ifSmartQueueis enabled for guild only commands.- Parameters:
guildSmartQueue- true if it should be enabled, otherwise false.
-
isDeleteUnknownCommands
public boolean isDeleteUnknownCommands()True if unknown commands should be deleted or not.
Standard:true- Returns:
- true if they are getting deleted, otherwise false.
-
setDeleteUnknownCommands
public void setDeleteUnknownCommands(boolean deleteUnknownCommands) True if unknown commands should be deleted and false if not.- Parameters:
deleteUnknownCommands- true if they should be getting deleted, otherwise false.
-
isDefaultPrintStacktrace
public boolean isDefaultPrintStacktrace()True if the stacktrace should be printed on anDIH4JDAThrowableEventif noDIH4JDAEventListeneris registered.
Standard:true- Returns:
- true if they are getting printed.
-
setDefaultPrintStacktrace
public void setDefaultPrintStacktrace(boolean defaultPrintStacktrace) True if the stacktrace should be printed on anDIH4JDAThrowableEventif noDIH4JDAEventListeneris registered.- Parameters:
defaultPrintStacktrace- true if they should be getting printed.
-
getExecutor
- Returns:
- the
Executorinstance.
-
setExecutor
Sets a newExecutor.- Parameters:
executor- the newExecutorto use.
-
isThrowUnregisteredException
public boolean isThrowUnregisteredException()- Returns:
- true if it will be thrown.
-
setThrowUnregisteredException
public void setThrowUnregisteredException(boolean throwUnregisteredException) True if theCommandNotRegisteredExceptionshould be thrown or not.- Parameters:
throwUnregisteredException- true if it should be thrown.
-