Package tv.phantombot.discord
Class DiscordAPI
java.lang.Object
tv.phantombot.discord.util.DiscordUtil
tv.phantombot.discord.DiscordAPI
Communicates with the Discord API.
- Author:
- IllusionaryOne, ScaniaTV
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum list of our connection states.final class
Nested classes/interfaces inherited from class tv.phantombot.discord.util.DiscordUtil
DiscordUtil.MessageCreateFile
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Method that checks if we are still connected to Discord and reconnects if we are not.void
connect()
void
Method to connect to Discord.static DiscordClient
Method that will return the current clientstatic GatewayDiscordClient
Method that will return the current gatewaystatic Guild
getGuild()
Method that will return the current guild.static Snowflake
static DiscordAPI
instance()
Method to return this class object.boolean
Method that checks if we are logged in to Discord.boolean
isReady()
Method that checks if Discord is ready and has sent all Guilds.void
Method to reconnect to Discord.void
testJoin()
static void
Updates the Discord Guild IDMethods inherited from class tv.phantombot.discord.util.DiscordUtil
addReaction, addReaction, addReactions, addReactions, addRole, addRole, addRole, bulkDelete, bulkDelete, bulkDeleteMessages, bulkDeleteMessages, canChannelPublish, canChannelPublish, channelId, channelIdAsString, channelName, createRole, deleteMessage, deleteRole, deleteRole, editMessageContent, editMessageEmbed, editUserRoles, editUserRoles, getAllChannelInfo, getAllChannelInfoAsync, getChannel, getChannelAsync, getChannelAsync, getChannelByID, getChannelByIDAsync, getColor, getGuildRoles, getGuildRolesAsync, getLastMessage, getMessageById, getMessagesBefore, getRole, getRoleAsync, getRoleByID, getRoleByIDAsync, getRoleObjects, getRoleObjectsAsync, getRolesAsync, getUser, getUserAsync, getUserById, getUserByIdAsync, getUserRoles, getUserRoles, getUserRolesAsync, getUserRolesAsync, getUsers, getUsersAsync, getUserWithDiscriminator, getUserWithDiscriminatorAsync, isAdministrator, isAdministrator, isAdministratorAsync, isAdministratorAsync, isValidFilePath, removeGame, removeRole, removeRole, resetPresence, sanitizeChannelName, sendFile, sendFile, sendFile, sendFile, sendFileAsync, sendFileAsync, sendFileAsync, sendMessage, sendMessage, sendMessageAsync, sendMessageAsync, sendMessageEmbed, sendMessageEmbed, sendMessageEmbed, sendMessageEmbed, sendMessageEmbedAsync, sendMessageEmbedAsync, sendMessageEmbedAsync, sendPrivateMessage, sendPrivateMessage, sendPrivateMessage, setCompeting, setGame, setListening, setPlaying, setStream, setStreaming, setWatching
-
Method Details
-
instance
Method to return this class object.- Returns:
-
connect
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
-
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
Method that will return the current guild.- Returns:
-
updateGuildId
public static void updateGuildId()Updates the Discord Guild ID -
getGuildId
-
getClient
Method that will return the current client- Returns:
-
getGateway
Method that will return the current gateway- Returns:
-