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 enumEnum list of our connection states.final classNested classes/interfaces inherited from class tv.phantombot.discord.util.DiscordUtil
DiscordUtil.MessageCreateFile -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod that checks if we are still connected to Discord and reconnects if we are not.voidconnect()voidMethod to connect to Discord.static DiscordClientMethod that will return the current clientstatic GatewayDiscordClientMethod that will return the current gatewaystatic GuildgetGuild()Method that will return the current guild.static Snowflakestatic DiscordAPIinstance()Method to return this class object.booleanMethod that checks if we are logged in to Discord.booleanisReady()Method that checks if Discord is ready and has sent all Guilds.voidMethod to reconnect to Discord.voidtestJoin()static voidUpdates 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:
-