Class DIH4JDABuilder

java.lang.Object
xyz.dynxsty.dih4jda.DIH4JDABuilder

public class DIH4JDABuilder extends Object
Builder-System used to build DIH4JDA.
  • Method Details

    • setJDA

      @Nonnull public static DIH4JDABuilder setJDA(@Nonnull net.dv8tion.jda.api.JDA instance)
      Sets the JDA instance the handler will be used for.
      Parameters:
      instance - The JDA instance.
    • setCommandPackages

      @Nonnull public DIH4JDABuilder setCommandPackages(@Nonnull String... pack)
      Sets the packages that house all Command classes. DIH4JDA then uses the ClassWalker to "scan" the packages for all command classes.
      Parameters:
      pack - The packages name.
    • setExecutor

      @Nonnull public DIH4JDABuilder setExecutor(@Nonnull Executor executor)
      Sets the Executor that will be used to execute all commands and events.
      Parameters:
      executor - The Executor.
    • disableLogging

      @Nonnull public DIH4JDABuilder disableLogging(@Nullable DIH4JDALogger.Type... types)
      Sets the types of logging that should be disabled.
      Parameters:
      types - All DIH4JDALogger.Type's that should be disabled.
    • disableStacktracePrinting

      @Nonnull public DIH4JDABuilder disableStacktracePrinting()
      Disables the printing of stacktrace if an exception happens and there is no event listener registered.
    • disableAutomaticCommandRegistration

      @Nonnull public DIH4JDABuilder disableAutomaticCommandRegistration()
      Whether DIH4JDA should automatically register all interactions on each onReady event. A manual registration of all interactions can be executed using DIH4JDA.registerInteractions().
    • setGlobalSmartQueue

      @Nonnull public DIH4JDABuilder setGlobalSmartQueue(boolean enable)
      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 each DIH4JDA.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 with disableUnknownCommandDeletion().
    • setGuildSmartQueue

      @Nonnull public DIH4JDABuilder setGuildSmartQueue(boolean enable)
      This will disable the GUILD Smart Queueing functionality. If the Guild SmartQueue is disabled Guild Slash/Context Commands get overridden on each DIH4JDA.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 with disableUnknownCommandDeletion().
    • disableUnknownCommandDeletion

      @Nonnull public DIH4JDABuilder disableUnknownCommandDeletion()
      Disables deletion of unknown/unused commands when using SmartQueue.
    • disableUnregisteredCommandException

      @Nonnull public DIH4JDABuilder disableUnregisteredCommandException()
      Disables the CommandNotRegisteredException getting thrown for unregistered commands.
    • build

      @Nonnull public DIH4JDA build() throws DIH4JDAException
      Returns a DIH4JDA instance that has been validated.
      Returns:
      the built, usable DIH4JDA
      Throws:
      DIH4JDAException