Class DiscordMain

java.lang.Object
java.lang.Thread
com.github.mafelp.discord.DiscordMain
All Implemented Interfaces:
Runnable

public class DiscordMain extends Thread
The class that handles initiation and destruction of the discord bot instance(s)
  • Field Details

    • loadAccounts

      private final boolean loadAccounts
      The switch that decides, if the Accounts should be loaded after the login of the Bot instance.
  • Constructor Details

    • DiscordMain

      public DiscordMain(boolean loadAccounts)
      Constructor to set the loadAccounts switch.
      Parameters:
      loadAccounts - if the accounts should be loaded after bot startup.
    • DiscordMain

      public DiscordMain()
      Constructor for normal discord instance startup. Does not load the Accounts in.
  • Method Details

    • run

      public void run()
      Method used to create the bot instance and log it in
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • registerSlashCommands

      private void registerSlashCommands()
      Method to register all slash commands (in bulk).
    • shutdown

      public static void shutdown()
      Shutdown method to disconnect the bot instance