Package xyz.dynxsty.dih4jda
Class DIH4JDABuilder
java.lang.Object
xyz.dynxsty.dih4jda.DIH4JDABuilder
Builder-System used to build
DIH4JDA.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns aDIH4JDAinstance that has been validated.Whether DIH4JDA should automatically register all interactions on each onReady event.disableLogging(DIH4JDALogger.Type... types) Sets the types of logging that should be disabled.Disables the printing of stacktrace if an exception happens and there is no event listener registered.Disables deletion of unknown/unused commands when using SmartQueue.Disables theCommandNotRegisteredExceptiongetting thrown for unregistered commands.setCommandPackages(String... pack) Sets the packages that house all Command classes.setExecutor(Executor executor) Sets the Executor that will be used to execute all commands and events.setGlobalSmartQueue(boolean enable) NOT RECOMMENDED (unless there are some bugs)
This will disable the GLOBAL Smart Queueing functionality.setGuildSmartQueue(boolean enable) This will disable the GUILD Smart Queueing functionality.static DIH4JDABuildersetJDA(net.dv8tion.jda.api.JDA instance) Sets theJDAinstance the handler will be used for.
-
Method Details
-
setJDA
Sets theJDAinstance the handler will be used for.- Parameters:
instance- TheJDAinstance.
-
setCommandPackages
Sets the packages that house all Command classes. DIH4JDA then uses theClassWalkerto "scan" the packages for all command classes.- Parameters:
pack- The packages name.
-
setExecutor
Sets the Executor that will be used to execute all commands and events.- Parameters:
executor- The Executor.
-
disableLogging
Sets the types of logging that should be disabled.- Parameters:
types- AllDIH4JDALogger.Type's that should be disabled.
-
disableStacktracePrinting
Disables the printing of stacktrace if an exception happens and there is no event listener registered. -
disableAutomaticCommandRegistration
Whether DIH4JDA should automatically register all interactions on each onReady event. A manual registration of all interactions can be executed usingDIH4JDA.registerInteractions(). -
setGlobalSmartQueue
NOT RECOMMENDED (unless there are some bugs)
This will disable the GLOBAL Smart Queueing functionality. If the Global SmartQueue is disabled Global Slash/Context Commands get overridden on eachDIH4JDA.registerInteractions()call, thus, making Global Commands unusable for about an hour, until they're registered again.
By default, this also deletes unknown/unused commands. This behaviour can be disabled withdisableUnknownCommandDeletion(). -
setGuildSmartQueue
This will disable the GUILD Smart Queueing functionality. If the Guild SmartQueue is disabled Guild Slash/Context Commands get overridden on eachDIH4JDA.registerInteractions()call. It is RECOMMENDED to disable this functionality for 300+ servers to shorten the start-up time. By default, this also deletes unknown/unused commands. This behaviour can be disabled withdisableUnknownCommandDeletion(). -
disableUnknownCommandDeletion
Disables deletion of unknown/unused commands when using SmartQueue. -
disableUnregisteredCommandException
Disables theCommandNotRegisteredExceptiongetting thrown for unregistered commands. -
build
Returns aDIH4JDAinstance that has been validated.- Returns:
- the built, usable
DIH4JDA - Throws:
DIH4JDAException
-