Interface ApplicationInfo
- All Superinterfaces:
ISnowflake
- Since:
- 3.0
- Author:
- Aljoscha Grebe
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumFlag constants corresponding to the Discord Enumstatic interfaceOAuth2 install parameter for the default in-app authorization link.static interfaceConfiguration of a singleIntegrationType. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the bot requires code grant to invite or not.The custom Authorization URL of this bot's application.The description of the bot's application.default EnumSet<ApplicationInfo.Flag>getFlags()TheFlagsset for the application.longThe raw bitset representing this application's flags.default ImageProxygetIcon()Returns anImageProxyfor this application info's icon.The icon id of the bot's application.The icon-url of the bot's application.The configurations for eachIntegrationTypeset on the application.The interaction endpoint URL of this bot's application.default StringgetInviteUrl(long guildId, Collection<Permission> permissions) Creates a OAuth invite-link used to invite the bot.default StringgetInviteUrl(long guildId, Permission... permissions) Creates a OAuth invite-link used to invite the bot.getInviteUrl(String guildId, Collection<Permission> permissions) Creates a OAuth invite-link used to invite the bot.default StringgetInviteUrl(String guildId, Permission... permissions) Creates a OAuth invite-link used to invite the bot.default StringgetInviteUrl(Collection<Permission> permissions) Creates a OAuth invite-link used to invite the bot.default StringgetInviteUrl(Permission... permissions) Creates a OAuth invite-link used to invite the bot.getJDA()TheJDAinstance of this ApplicationInfo (the one logged into this application's bot account).getName()The name of the bot's application.getOwner()The owner of the bot's application.AnEnumSetof permissions the default authorization URL is set up with.longThelongrepresentation of the literal permissions the default authorization URL is set up with.The URL for the application's privacy policy.AListcontaining the OAuth2 redirect URIs of this bot's application.The role connections (linked roles) verification URL of this bot's application.AListof scopes the default authorization URL is set up with.getTags()AListcontaining the tags of this bot's application.getTeam()The team information for this application.The URL for the application's terms of service.longThe approximate count of users that have installed this application, or-1if it is unknown.booleanWhether the bot is public or not.default ApplicationInfosetRequiredScopes(String... scopes) Configures the required scopes applied to thegetInviteUrl(Permission...)and similar methods.setRequiredScopes(Collection<String> scopes) Configures the required scopes applied to thegetInviteUrl(Permission...)and similar methods.Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
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=codetogether with a valid&redirect_uri.
For more information look at the Discord OAuth2 documentation.- Returns:
- Whether the bot requires code grant
-
getDescription
The description of the bot's application.- Returns:
- The description of the bot's application or an empty
Stringif no description is defined
-
getTermsOfServiceUrl
The URL for the application's terms of service.- Returns:
- The URL for the application's terms of service or
nullif none is set
-
getPrivacyPolicyUrl
The URL for the application's privacy policy.- Returns:
- The URL for the application's privacy policy or
nullif none is set
-
getIconId
The icon id of the bot's application.
The application icon is not necessarily the same as the bot's avatar!- Returns:
- The icon id of the bot's application or null if no icon is defined
-
getIconUrl
The icon-url of the bot's application.
The application icon is not necessarily the same as the bot's avatar!- Returns:
- The icon-url of the bot's application or null if no icon is defined
-
getIcon
Returns anImageProxyfor this application info's icon.- Returns:
- The
ImageProxyof this application info's icon or null if no icon is defined - See Also:
-
getTeam
The team information for this application.- Returns:
- The
ApplicationTeam, or null if this application is not in a team.
-
setRequiredScopes
Configures the required scopes applied to thegetInviteUrl(Permission...)and similar methods.
The scope"bot"is always applied.- Parameters:
scopes- The scopes to use withgetInviteUrl(Permission...)and the likes- Returns:
- The current ApplicationInfo instance
- Throws:
IllegalArgumentException- If null is provided
-
setRequiredScopes
Configures the required scopes applied to thegetInviteUrl(Permission...)and similar methods.
The scope"bot"is always applied.- Parameters:
scopes- The scopes to use withgetInviteUrl(Permission...)and the likes- Returns:
- The current ApplicationInfo instance
- Throws:
IllegalArgumentException- If null is provided
-
getInviteUrl
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discord.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS
Unnecessary query parameters are stripped.- Parameters:
permissions- Possibly emptyCollectionofPermissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
-
getInviteUrl
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discord.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS
Unnecessary query parameters are stripped.- Parameters:
permissions-Permissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
-
getInviteUrl
@Nonnull String getInviteUrl(@Nullable String guildId, @Nullable Collection<Permission> permissions) Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discord.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
Unnecessary query parameters are stripped.- Parameters:
guildId- The id of the pre-selected guild.permissions- Possibly emptyCollectionofPermissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
- Throws:
NumberFormatException- If the providedidcannot be parsed byLong.parseLong(String)
-
getInviteUrl
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discord.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
Unnecessary query parameters are stripped.- Parameters:
guildId- The id of the pre-selected guild.permissions- Possibly emptyCollectionofPermissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
-
getInviteUrl
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discord.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
Unnecessary query parameters are stripped.- Parameters:
guildId- The id of the pre-selected guild.permissions- Possibly empty array ofPermissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
- Throws:
NumberFormatException- If the providedidcannot be parsed byLong.parseLong(String)
-
getInviteUrl
Creates a OAuth invite-link used to invite the bot.The link is provided in the following format:
https://discord.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot&permissions=PERMISSIONS&guild_id=GUILD_ID
Unnecessary query parameters are stripped.- Parameters:
guildId- The id of the pre-selected guild.permissions- Possibly empty array ofPermissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
-
getJDA
TheJDAinstance of this ApplicationInfo (the one logged into this application's bot account).- Returns:
- The JDA instance of this ApplicationInfo
-
getName
The name of the bot's application.
The application name is not necessarily the same as the bot's name!- Returns:
- The name of the bot's application.
-
getOwner
The owner of the bot's application.- Returns:
- The owner of the bot's application
-
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 guilds.- Returns:
- Whether the bot is public
-
getTags
AListcontaining the tags of this bot's application.This List is empty if no tags are set in the Developer Portal.
- Returns:
- Immutable list containing the tags of this bot's application
-
getRedirectUris
AListcontaining the OAuth2 redirect URIs of this bot's application.This List is empty if no redirect URIs are set in the Developer Portal.
- Returns:
- Immutable list containing the OAuth2 redirect URIs of this bot's application
-
getInteractionsEndpointUrl
The interaction endpoint URL of this bot's application.This returns
nullif no interaction endpoint URL is set in the Developer Portal.A non-null value means your bot will no longer receive
interactionsthrough JDA, such as slash commands, components and modals.- Returns:
- Interaction endpoint URL of this bot's application, or
nullif it has not been set
-
getRoleConnectionsVerificationUrl
The role connections (linked roles) verification URL of this bot's application.This returns
nullif no role connection verification URL is set in the Developer Portal.- Returns:
- Role connections verification URL of this bot's application, or
nullif it has not been set
-
getCustomAuthorizationUrl
The custom Authorization URL of this bot's application.This returns
nullif no custom URL is set in the Developer Portal or if In-app Authorization is enabled.- Returns:
- Custom Authorization URL, or null if it has not been set
-
getScopes
AListof scopes the default authorization URL is set up with.This List is empty if you set a custom URL in the Developer Portal.
- Returns:
- Immutable list of scopes the default authorization URL is set up with.
-
getPermissions
AnEnumSetof permissions the default authorization URL is set up with.This is empty if you set a custom URL in the Developer Portal.
- Returns:
- Set of permissions the default authorization URL is set up with.
-
getPermissionsRaw
long getPermissionsRaw()Thelongrepresentation of the literal permissions the default authorization URL is set up with.- Returns:
- Never-negative long containing offset permissions the default authorization URL is set up with.
-
getFlags
TheFlagsset for the application.
Modifying the returned EnumSet will have not actually change the flags of the application.- Returns:
EnumSetofApplicationInfo.Flag
-
getFlagsRaw
long getFlagsRaw()The raw bitset representing this application's flags.- Returns:
- The bitset
-
getUserInstallCount
long getUserInstallCount()The approximate count of users that have installed this application, or-1if it is unknown.- Returns:
- The approximate count of users that have installed this application.
-
getIntegrationTypesConfig
@Nonnull Map<IntegrationType,ApplicationInfo.IntegrationTypeConfiguration> getIntegrationTypesConfig()The configurations for eachIntegrationTypeset on the application.- Returns:
- The configurations for each integration type
-