Class ApplicationInfoImpl
- All Implemented Interfaces:
ApplicationInfo
,ISnowflake
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.ApplicationInfo
ApplicationInfo.Flag, ApplicationInfo.InstallParameters, ApplicationInfo.IntegrationTypeConfiguration
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.ApplicationInfo
MAX_DESCRIPTION_LENGTH, MAX_TAG_LENGTH, MAX_TAGS, MAX_URL_LENGTH
-
Constructor Summary
ConstructorsConstructorDescriptionApplicationInfoImpl
(JDA api, String description, boolean doesBotRequireCodeGrant, String iconId, long id, long flags, boolean isBotPublic, String name, String termsOfServiceUrl, String privacyPolicyUrl, User owner, ApplicationTeam team, List<String> tags, List<String> redirectUris, String interactionsEndpointUrl, String roleConnectionsVerificationUrl, String customAuthUrl, long defaultAuthUrlPerms, List<String> defaultAuthUrlScopes, long approxUserInstallCount, Map<IntegrationType, ApplicationInfo.IntegrationTypeConfiguration> integrationTypesConfig) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Whether the bot requires code grant to invite or not.boolean
The custom Authorization URL of this bot's application.The description of the bot's application.long
The raw bitset representing this application's flags.The icon id of the bot's application.The icon-url of the bot's application.long
The Snowflake id of this entity.The configurations for eachIntegrationType
set on the application.The interaction endpoint URL of this bot's application.getInviteUrl
(String guildId, Collection<Permission> permissions) Creates a OAuth invite-link used to invite the bot.getJDA()
TheJDA
instance 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.AnEnumSet
of permissions the default authorization URL is set up with.long
Thelong
representation of the literal permissions the default authorization URL is set up with.The URL for the application's privacy policy.AList
containing the OAuth2 redirect URIs of this bot's application.The role connections (linked roles) verification URL of this bot's application.AList
of scopes the default authorization URL is set up with.getTags()
AList
containing the tags of this bot's application.getTeam()
The team information for this application.The URL for the application's terms of service.long
The approximate count of users that have installed this application, or-1
if it is unknown.int
hashCode()
final boolean
Whether the bot is public or not.setRequiredScopes
(Collection<String> scopes) Configures the required scopes applied to theApplicationInfo.getInviteUrl(Permission...)
and similar methods.toString()
Methods inherited from interface net.dv8tion.jda.api.entities.ApplicationInfo
getFlags, getIcon, getInviteUrl, getInviteUrl, getInviteUrl, getInviteUrl, getInviteUrl, setRequiredScopes
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
ApplicationInfoImpl
public ApplicationInfoImpl(JDA api, String description, boolean doesBotRequireCodeGrant, String iconId, long id, long flags, boolean isBotPublic, String name, String termsOfServiceUrl, String privacyPolicyUrl, User owner, ApplicationTeam team, List<String> tags, List<String> redirectUris, String interactionsEndpointUrl, String roleConnectionsVerificationUrl, String customAuthUrl, long defaultAuthUrlPerms, List<String> defaultAuthUrlScopes, long approxUserInstallCount, Map<IntegrationType, ApplicationInfo.IntegrationTypeConfiguration> integrationTypesConfig)
-
-
Method Details
-
doesBotRequireCodeGrant
public final boolean doesBotRequireCodeGrant()Description copied from interface:ApplicationInfo
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.- Specified by:
doesBotRequireCodeGrant
in interfaceApplicationInfo
- Returns:
- Whether the bot requires code grant
-
equals
-
getDescription
Description copied from interface:ApplicationInfo
The description of the bot's application.- Specified by:
getDescription
in interfaceApplicationInfo
- Returns:
- The description of the bot's application or an empty
String
if no description is defined
-
getTermsOfServiceUrl
Description copied from interface:ApplicationInfo
The URL for the application's terms of service.- Specified by:
getTermsOfServiceUrl
in interfaceApplicationInfo
- Returns:
- The URL for the application's terms of service or
null
if none is set
-
getPrivacyPolicyUrl
Description copied from interface:ApplicationInfo
The URL for the application's privacy policy.- Specified by:
getPrivacyPolicyUrl
in interfaceApplicationInfo
- Returns:
- The URL for the application's privacy policy or
null
if none is set
-
getIconId
Description copied from interface:ApplicationInfo
The icon id of the bot's application.
The application icon is not necessarily the same as the bot's avatar!- Specified by:
getIconId
in interfaceApplicationInfo
- Returns:
- The icon id of the bot's application or null if no icon is defined
-
getIconUrl
Description copied from interface:ApplicationInfo
The icon-url of the bot's application.
The application icon is not necessarily the same as the bot's avatar!- Specified by:
getIconUrl
in interfaceApplicationInfo
- Returns:
- The icon-url of the bot's application or null if no icon is defined
-
getTeam
Description copied from interface:ApplicationInfo
The team information for this application.- Specified by:
getTeam
in interfaceApplicationInfo
- Returns:
- The
ApplicationTeam
, or null if this application is not in a team.
-
setRequiredScopes
Description copied from interface:ApplicationInfo
Configures the required scopes applied to theApplicationInfo.getInviteUrl(Permission...)
and similar methods.
The scope"bot"
is always applied.- Specified by:
setRequiredScopes
in interfaceApplicationInfo
- Parameters:
scopes
- The scopes to use withApplicationInfo.getInviteUrl(Permission...)
and the likes- Returns:
- The current ApplicationInfo instance
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getInviteUrl
Description copied from interface:ApplicationInfo
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.- Specified by:
getInviteUrl
in interfaceApplicationInfo
- Parameters:
guildId
- The id of the pre-selected guild.permissions
- Possibly emptyCollection
ofPermissions
that should be requested via invite.- Returns:
- The link used to invite the bot
-
getJDA
Description copied from interface:ApplicationInfo
TheJDA
instance of this ApplicationInfo (the one logged into this application's bot account).- Specified by:
getJDA
in interfaceApplicationInfo
- Returns:
- The JDA instance of this ApplicationInfo
-
getName
Description copied from interface:ApplicationInfo
The name of the bot's application.
The application name is not necessarily the same as the bot's name!- Specified by:
getName
in interfaceApplicationInfo
- Returns:
- The name of the bot's application.
-
getOwner
Description copied from interface:ApplicationInfo
The owner of the bot's application.- Specified by:
getOwner
in interfaceApplicationInfo
- Returns:
- The owner of the bot's application
-
hashCode
public int hashCode() -
isBotPublic
public final boolean isBotPublic()Description copied from interface:ApplicationInfo
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.- Specified by:
isBotPublic
in interfaceApplicationInfo
- Returns:
- Whether the bot is public
-
getTags
Description copied from interface:ApplicationInfo
AList
containing the tags of this bot's application.This List is empty if no tags are set in the Developer Portal.
- Specified by:
getTags
in interfaceApplicationInfo
- Returns:
- Immutable list containing the tags of this bot's application
-
getRedirectUris
Description copied from interface:ApplicationInfo
AList
containing the OAuth2 redirect URIs of this bot's application.This List is empty if no redirect URIs are set in the Developer Portal.
- Specified by:
getRedirectUris
in interfaceApplicationInfo
- Returns:
- Immutable list containing the OAuth2 redirect URIs of this bot's application
-
getInteractionsEndpointUrl
Description copied from interface:ApplicationInfo
The interaction endpoint URL of this bot's application.This returns
null
if no interaction endpoint URL is set in the Developer Portal.A non-null value means your bot will no longer receive
interactions
through JDA, such as slash commands, components and modals.- Specified by:
getInteractionsEndpointUrl
in interfaceApplicationInfo
- Returns:
- Interaction endpoint URL of this bot's application, or
null
if it has not been set
-
getRoleConnectionsVerificationUrl
Description copied from interface:ApplicationInfo
The role connections (linked roles) verification URL of this bot's application.This returns
null
if no role connection verification URL is set in the Developer Portal.- Specified by:
getRoleConnectionsVerificationUrl
in interfaceApplicationInfo
- Returns:
- Role connections verification URL of this bot's application, or
null
if it has not been set
-
getCustomAuthorizationUrl
Description copied from interface:ApplicationInfo
The custom Authorization URL of this bot's application.This returns
null
if no custom URL is set in the Developer Portal or if In-app Authorization is enabled.- Specified by:
getCustomAuthorizationUrl
in interfaceApplicationInfo
- Returns:
- Custom Authorization URL, or null if it has not been set
-
getPermissions
Description copied from interface:ApplicationInfo
AnEnumSet
of permissions the default authorization URL is set up with.This is empty if you set a custom URL in the Developer Portal.
- Specified by:
getPermissions
in interfaceApplicationInfo
- Returns:
- Set of permissions the default authorization URL is set up with.
-
getPermissionsRaw
public long getPermissionsRaw()Description copied from interface:ApplicationInfo
Thelong
representation of the literal permissions the default authorization URL is set up with.- Specified by:
getPermissionsRaw
in interfaceApplicationInfo
- Returns:
- Never-negative long containing offset permissions the default authorization URL is set up with.
-
getFlagsRaw
public long getFlagsRaw()Description copied from interface:ApplicationInfo
The raw bitset representing this application's flags.- Specified by:
getFlagsRaw
in interfaceApplicationInfo
- Returns:
- The bitset
-
getScopes
Description copied from interface:ApplicationInfo
AList
of scopes the default authorization URL is set up with.This List is empty if you set a custom URL in the Developer Portal.
- Specified by:
getScopes
in interfaceApplicationInfo
- Returns:
- Immutable list of scopes the default authorization URL is set up with.
-
getUserInstallCount
public long getUserInstallCount()Description copied from interface:ApplicationInfo
The approximate count of users that have installed this application, or-1
if it is unknown.- Specified by:
getUserInstallCount
in interfaceApplicationInfo
- Returns:
- The approximate count of users that have installed this application.
-
getIntegrationTypesConfig
@Nonnull public Map<IntegrationType,ApplicationInfo.IntegrationTypeConfiguration> getIntegrationTypesConfig()Description copied from interface:ApplicationInfo
The configurations for eachIntegrationType
set on the application.- Specified by:
getIntegrationTypesConfig
in interfaceApplicationInfo
- Returns:
- The configurations for each integration type
-
toString
-