Package xyz.dynxsty.dih4jda
Class DIH4JDABuilder
java.lang.Object
xyz.dynxsty.dih4jda.DIH4JDABuilder
Builder class used to instantiate a new
DIH4JDA instance.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a validatedDIH4JDAinstance.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 stacktrace-printing for all raised exceptions that were not caught by anDIH4JDAEventListener.Disables the deletion of unknown/unused commands while using SmartQueue.Disables theCommandNotRegisteredExceptiongetting thrown for unregistered commands.setCommandPackages(String... pack) Allows to specify package(s) that house allApplicationCommands classes.setExecutor(Executor executor) Allows to specify a customExecutorthat 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.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
setCommandPackages
Allows to specify package(s) that house allApplicationCommands classes. DIH4JDA then uses theClassWalkerto "scan" for those classes.- Parameters:
pack- The packages.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
setExecutor
Allows to specify a customExecutorthat will be used to execute all commands and events.- Parameters:
executor- The customExecutor.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
disableLogging
Sets the types of logging that should be disabled.- Parameters:
types- AllDIH4JDALogger.Type's that should be disabled.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
disableStacktracePrinting
Disables stacktrace-printing for all raised exceptions that were not caught by anDIH4JDAEventListener.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
disableAutomaticCommandRegistration
Whether DIH4JDA should automatically register all interactions on each onReady event. A manual registration of all interactions can be executed usingDIH4JDA.registerInteractions().- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
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().- Parameters:
enable- aBooleanthat is true if theSmartQueueshould be enabled for global commands.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
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().- Parameters:
enable- aBooleanthat is true if theSmartQueueshould be enabled for guild commands.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
disableUnknownCommandDeletion
Disables the deletion of unknown/unused commands while using SmartQueue.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
disableUnregisteredCommandException
Disables theCommandNotRegisteredExceptiongetting thrown for unregistered commands.- Returns:
- The
DIH4JDABuilderfor chaining convenience.
-
build
Returns a validatedDIH4JDAinstance.- Returns:
- The built, usable
DIH4JDA - Throws:
DIH4JDAException- If anything was wrong with your configuration.
-