Class DiscordAPI


public class DiscordAPI extends DiscordUtil
Communicates with the Discord API.
Author:
IllusionaryOne, ScaniaTV
  • Method Details

    • instance

      public static DiscordAPI instance()
      Method to return this class object.
      Returns:
    • connect

      public void connect(String token)
      Method to connect to Discord.
      Parameters:
      token -
    • connect

      public void connect()
    • reconnect

      public void reconnect()
      Method to reconnect to Discord.
    • isLoggedIn

      public boolean isLoggedIn()
      Method that checks if we are logged in to Discord.
      Returns:
    • isReady

      public boolean isReady()
      Method that checks if Discord is ready and has sent all Guilds.
      Returns:
    • getConnectionState

      public DiscordAPI.ConnectionState getConnectionState()
    • testJoin

      public void testJoin()
    • checkConnectionStatus

      public void checkConnectionStatus()
      Method that checks if we are still connected to Discord and reconnects if we are not.
    • getGuild

      public static Guild getGuild()
      Method that will return the current guild.
      Returns:
    • updateGuildId

      public static void updateGuildId()
      Updates the Discord Guild ID
    • getGuildId

      public static Snowflake getGuildId()
    • getClient

      public static DiscordClient getClient()
      Method that will return the current client
      Returns:
    • getGateway

      public static GatewayDiscordClient getGateway()
      Method that will return the current gateway
      Returns: