Class DiscordBot

java.lang.Object
me.therealkeyis.DiscordBot

public class DiscordBot extends Object
Singleton that handles communications to and from the discord api
  • Method Details

    • migrateChannels

      public void migrateChannels()
      This will verify that all channels that are used by this bot will be inside of the "discord_category" named category.
    • sendMessage

      public void sendMessage(String content)
      Sends a message to the channel saved in CHAT_CHANNEL.
      Parameters:
      content - The text to send to the channel.
    • messageDev

      public void messageDev(String requestUser, String content)
      Sends a message to the developer on discord
      Parameters:
      requestUser - The user sending the message
      content - The content in the message
    • createChannel

      public String createChannel(String channelName, String serverId)
      Creates a discord voice channel with the provided channelName on the server with the associated serverId
      Parameters:
      channelName - The name of the new channel
      serverId - The server id of the server to create the channel
      Returns:
      Returns the channelId of the new channel
    • getGuild

      public String getGuild(String usernameWithId)
      Gets the guild id from a discord username with id
      Parameters:
      usernameWithId - The discord username with an id
      Returns:
      A discord guild id as a string
    • getInstance

      public static DiscordBot getInstance()
      Fetches the current DiscordBot instance.
      Returns:
      Static DiscordBot instance
    • configureInstance

      public static void configureInstance(DiscordConfig config)
      Configures variables required for discord interaction.
      Parameters:
      config - A discord configuration object
    • movePlayer

      public void movePlayer(String name, String channelId)
      Moves a player from one voice chat to another
      Parameters:
      name - The username of the player to move
      channelId - The channel id of the channel to move them to
    • movePlayerDefault

      public void movePlayerDefault(String name)
      Moves a player to the default voice channel
      Parameters:
      name - The name of the player to move
    • increaseActivePlayerCount

      public void increaseActivePlayerCount()
      Increases the active player count for the discord status
    • decreaseActivePlayerCount

      public void decreaseActivePlayerCount()
      Decreases the active player count for the discord status