Package com.mrivanplays.jdoa2
Class DiscordToken
java.lang.Object
com.mrivanplays.jdoa2.DiscordToken
Represents a token, retrieved from discord API. Holds access token, which at some point, expires, and a refresh token
to refresh the access token.
-
Constructor Summary
ConstructorsConstructorDescriptionDiscordToken
(String accessToken, long expiresIn, String refreshToken, String scope, String tokenType) -
Method Summary
Modifier and TypeMethodDescriptionReturns the access token.long
Returns whenever the access token expires.Returns the refresh token, used to refresh the access token.getScope()
Returns the scopes we're allowed to get information for.Returns the type of the discord token.String[]
Parses the scopes to a json array, for easily iterating thru them.
-
Constructor Details
-
DiscordToken
-
-
Method Details
-
getAccessToken
Returns the access token.- Returns:
- access token
-
getTokenType
Returns the type of the discord token. This may be null if discord api didn't specify it.- Returns:
- token type
-
getExpiresIn
public long getExpiresIn()Returns whenever the access token expires. This may be 0 if discord api didn't specify it.- Returns:
- expires in
-
getRefreshToken
Returns the refresh token, used to refresh the access token.- Returns:
- refresh token
-
getScope
Returns the scopes we're allowed to get information for.- Returns:
- scope
-
parseScopes
Parses the scopes to a json array, for easily iterating thru them.- Returns:
- scope array
-