Package net.dv8tion.jda.client.entities
Interface Application
-
- All Superinterfaces:
ISnowflake
public interface Application extends ISnowflake
Represents a Discord Application from its owning client point of view- Since:
- 3.0
- Author:
- Aljoscha Grebe
- See Also:
- Discord Documentation - My Apps,
JDAClient.getApplications()
,JDAClient.getApplicationById(String)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Application.Bot
Represents a Bot assigned to an Application To change its Username, login to JDA and use theAccountManager
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RestAction<Application.Bot>
createBot()
Creates a new Bot for this Application.RestAction<java.lang.Void>
delete()
Deletes this Application and its assigned Bot (if present).boolean
doesBotRequireCodeGrant()
Whether the bot requires code grant to invite or not.Application.Bot
getBot()
The Bot assigned to this Applicationjava.lang.String
getDescription()
The description of the application.int
getFlags()
The flags for this application.java.lang.String
getIconId()
The icon id of the application.java.lang.String
getIconUrl()
The icon-url of the application.JDA
getJDA()
TheJDA
instance of this Application (the one owning this application).ApplicationManager
getManager()
Returns theApplicationManager
for this Application.java.lang.String
getName()
The name of this application.java.util.List<java.lang.String>
getRedirectUris()
The redirect uris of this application.int
getRpcApplicationState()
The rpc application state of this application.java.lang.String
getSecret()
Returns the Application secret (Used for oAuth)boolean
hasBot()
Returns whether or not this Application has a bot-account assignedboolean
isBotPublic()
Whether the bot is public or not.RestAction<Application>
resetSecret()
Generates a new client secret for this Application.-
Methods inherited from interface net.dv8tion.jda.core.entities.ISnowflake
getCreationTime, getId, getIdLong
-
-
-
-
Method Detail
-
createBot
@CheckReturnValue RestAction<Application.Bot> createBot()
Creates a new Bot for this Application. This cannot be undone! A new Bot will only be created if no bot-account is already assigned, otherwise the existing one is returned. A newly created Bot-account will have its name set to the name of the Application.Warning! This endpoint has a really long ratelimit (multiple hours)!
Possible
ErrorResponses
for this update include the following:UNKNOWN_APPLICATION
If the Application has been deleted
- Returns:
RestAction
- Type:Application.Bot
The created bot account of this application.
-
delete
@CheckReturnValue RestAction<java.lang.Void> delete()
Deletes this Application and its assigned Bot (if present). This cannot be undone!Possible
ErrorResponses
for this update include the following:UNKNOWN_APPLICATION
If the Application has already been deleted
- Returns:
RestAction
- Type:Void
The RestAction to delete this Application.
-
doesBotRequireCodeGrant
boolean doesBotRequireCodeGrant()
Whether the bot requires code grant to invite or not.This means that additional OAuth2 steps are required to authorize the application to make a bot join a guild like
&response_type=code
together with a valid&redirect_uri
.
For more information look at the Discord OAuth2 documentation.- Returns:
- Whether the bot requires code grant
-
getBot
Application.Bot getBot()
The Bot assigned to this Application- Returns:
- The
Application.Bot
assigned to this application, ornull
if no bot is assigned
-
getDescription
java.lang.String getDescription()
The description of the application.- Returns:
- The description of the application or an empty
String
if no description is defined
-
getFlags
int getFlags()
The flags for this application. These are used for whitelisted apps.- Returns:
- The application flags
-
getIconId
java.lang.String getIconId()
The icon id of the application.
The application icon is not necessarily the same as the bot's avatar!- Returns:
- The iconId of the application or
null
if no icon is defined
-
getIconUrl
java.lang.String getIconUrl()
The icon-url of the application.
The application icon is not necessarily the same as the bot's avatar!- Returns:
- The icon-url of the application or
null
if no icon is defined
-
getJDA
JDA getJDA()
TheJDA
instance of this Application (the one owning this application).- Returns:
- The JDA instance of this Application
-
getManager
ApplicationManager getManager()
Returns theApplicationManager
for this Application.
In the ApplicationManager, you can modify things like the name and icon of this Application. You modify multiple fields in one request by chaining setters before callingRestAction.queue()
.- Returns:
- The ApplicationManager of this Channel
-
getName
java.lang.String getName()
The name of this application.
The application name is not necessarily the same as the bot's name!- Returns:
- The name of this application
-
getRedirectUris
java.util.List<java.lang.String> getRedirectUris()
The redirect uris of this application.- Returns:
- A
List
of current redirect uris of the application
-
getRpcApplicationState
int getRpcApplicationState()
The rpc application state of this application.- Returns:
- The rpc application state of current redirect uris of the application
-
getSecret
java.lang.String getSecret()
Returns the Application secret (Used for oAuth)- Returns:
- The Application secret
-
hasBot
boolean hasBot()
Returns whether or not this Application has a bot-account assigned- Returns:
- True, if this Application has a bot-account assigned, false otherwise
-
isBotPublic
boolean isBotPublic()
Whether the bot is public or not. Public bots can be added by anyone. When false only the owner can invite the bot to servers.- Returns:
- Whether the bot is public
-
resetSecret
@CheckReturnValue RestAction<Application> resetSecret()
Generates a new client secret for this Application. This invalidates the old one.Possible
ErrorResponses
for this update include the following:UNKNOWN_APPLICATION
If the Application has been deleted
- Returns:
RestAction
- Type:Application
This application with the updated secret.
-
-