Package me.therealkeyis
Class DiscordBot
java.lang.Object
me.therealkeyis.DiscordBot
Singleton that handles communications to and from the discord api
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigureInstance(DiscordConfig config) Configures variables required for discord interaction.createChannel(String channelName, String serverId) Creates a discord voice channel with the provided channelName on the server with the associated serverIdvoidDecreases the active player count for the discord statusGets the guild id from a discord username with idstatic DiscordBotFetches the current DiscordBot instance.voidIncreases the active player count for the discord statusvoidmessageDev(String requestUser, String content) Sends a message to the developer on discordvoidThis will verify that all channels that are used by this bot will be inside of the "discord_category" named category.voidmovePlayer(String name, String channelId) Moves a player from one voice chat to anothervoidmovePlayerDefault(String name) Moves a player to the default voice channelvoidsendMessage(String content) Sends a message to the channel saved in CHAT_CHANNEL.
-
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
Sends a message to the channel saved in CHAT_CHANNEL.- Parameters:
content- The text to send to the channel.
-
messageDev
Sends a message to the developer on discord- Parameters:
requestUser- The user sending the messagecontent- The content in the message
-
createChannel
Creates a discord voice channel with the provided channelName on the server with the associated serverId- Parameters:
channelName- The name of the new channelserverId- The server id of the server to create the channel- Returns:
- Returns the channelId of the new channel
-
getGuild
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
Fetches the current DiscordBot instance.- Returns:
- Static DiscordBot instance
-
configureInstance
Configures variables required for discord interaction.- Parameters:
config- A discord configuration object
-
movePlayer
Moves a player from one voice chat to another- Parameters:
name- The username of the player to movechannelId- The channel id of the channel to move them to
-
movePlayerDefault
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
-