Interface ApplicationInfo
-
- All Superinterfaces:
ISnowflake
public interface ApplicationInfo extends ISnowflake
Represents a Discord Application from its bot's point of view.- Since:
- 3.0
- Author:
- Aljoscha Grebe
- See Also:
JDA.retrieveApplicationInfo()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleandoesBotRequireCodeGrant()Whether the bot requires code grant to invite or not.java.lang.StringgetDescription()The description of the bot's application.java.lang.StringgetIconId()The icon id of the bot's application.java.lang.StringgetIconUrl()The icon-url of the bot's application.default java.lang.StringgetInviteUrl(long guildId, java.util.Collection<Permission> permissions)Creates a OAuth invite-link used to invite the bot.default java.lang.StringgetInviteUrl(long guildId, Permission... permissions)Creates a OAuth invite-link used to invite the bot.java.lang.StringgetInviteUrl(java.lang.String guildId, java.util.Collection<Permission> permissions)Creates a OAuth invite-link used to invite the bot.default java.lang.StringgetInviteUrl(java.lang.String guildId, Permission... permissions)Creates a OAuth invite-link used to invite the bot.default java.lang.StringgetInviteUrl(java.util.Collection<Permission> permissions)Creates a OAuth invite-link used to invite the bot.default java.lang.StringgetInviteUrl(Permission... permissions)Creates a OAuth invite-link used to invite the bot.JDAgetJDA()TheJDAinstance of this ApplicationInfo (the one logged into this application's bot account).java.lang.StringgetName()The name of the bot's application.UsergetOwner()The owner of the bot's application.java.lang.StringgetPrivacyPolicyUrl()The URL for the application's privacy policy.ApplicationTeamgetTeam()The team information for this application.java.lang.StringgetTermsOfServiceUrl()The URL for the application's terms of service.booleanisBotPublic()Whether the bot is public or not.default ApplicationInfosetRequiredScopes(java.lang.String... scopes)Configures the required scopes applied to thegetInviteUrl(Permission...)and similar methods.ApplicationInfosetRequiredScopes(java.util.Collection<java.lang.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 Detail
-
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
@Nonnull java.lang.String 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
@Nullable java.lang.String 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
@Nullable java.lang.String getPrivacyPolicyUrl()
The URL for the application's privacy policy.- Returns:
- The URL for the application's privacy policy or
nullif none is set
-
getIconId
@Nullable java.lang.String 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
@Nullable java.lang.String 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
-
getTeam
@Nullable ApplicationTeam getTeam()
The team information for this application.- Returns:
- The
ApplicationTeam, or null if this application is not in a team.
-
setRequiredScopes
@Nonnull default ApplicationInfo setRequiredScopes(@Nonnull java.lang.String... scopes)
Configures the required scopes applied to thegetInviteUrl(Permission...)and similar methods.
To use slash commands you must add"applications.commands"to these scopes. The scope"bot"is always applied.- Parameters:
scopes- The scopes to use withgetInviteUrl(Permission...)and the likes- Returns:
- The current ApplicationInfo instance
- Throws:
java.lang.IllegalArgumentException- If null is provided
-
setRequiredScopes
@Nonnull ApplicationInfo setRequiredScopes(@Nonnull java.util.Collection<java.lang.String> scopes)
Configures the required scopes applied to thegetInviteUrl(Permission...)and similar methods.
To use slash commands you must add"applications.commands"to these scopes. The scope"bot"is always applied.- Parameters:
scopes- The scopes to use withgetInviteUrl(Permission...)and the likes- Returns:
- The current ApplicationInfo instance
- Throws:
java.lang.IllegalArgumentException- If null is provided
-
getInviteUrl
@Nonnull default java.lang.String getInviteUrl(@Nullable java.util.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
Unnecessary query parameters are stripped.- Parameters:
permissions- Possibly emptyCollectionofPermissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
-
getInviteUrl
@Nonnull default java.lang.String getInviteUrl(@Nullable 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
Unnecessary query parameters are stripped.- Parameters:
permissions-Permissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
-
getInviteUrl
@Nonnull java.lang.String getInviteUrl(@Nullable java.lang.String guildId, @Nullable java.util.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:
java.lang.NumberFormatException- If the providedidcannot be parsed byLong.parseLong(String)
-
getInviteUrl
@Nonnull default java.lang.String getInviteUrl(long guildId, @Nullable java.util.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
-
getInviteUrl
@Nonnull default java.lang.String getInviteUrl(@Nullable java.lang.String guildId, @Nullable 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 empty array ofPermissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
- Throws:
java.lang.NumberFormatException- If the providedidcannot be parsed byLong.parseLong(String)
-
getInviteUrl
@Nonnull default java.lang.String getInviteUrl(long guildId, @Nullable 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 empty array ofPermissionsthat should be requested via invite.- Returns:
- The link used to invite the bot
-
getJDA
@Nonnull JDA getJDA()
TheJDAinstance of this ApplicationInfo (the one logged into this application's bot account).- Returns:
- The JDA instance of this ApplicationInfo
-
getName
@Nonnull java.lang.String 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
@Nonnull User 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
-
-