Class ApplicationInfoImpl

java.lang.Object
net.dv8tion.jda.internal.entities.ApplicationInfoImpl
All Implemented Interfaces:
ApplicationInfo, ISnowflake

public class ApplicationInfoImpl extends Object implements ApplicationInfo
  • Constructor Details

  • 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 interface ApplicationInfo
      Returns:
      Whether the bot requires code grant
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getDescription

      @Nonnull public String getDescription()
      Description copied from interface: ApplicationInfo
      The description of the bot's application.
      Specified by:
      getDescription in interface ApplicationInfo
      Returns:
      The description of the bot's application or an empty String if no description is defined
    • getTermsOfServiceUrl

      public String getTermsOfServiceUrl()
      Description copied from interface: ApplicationInfo
      The URL for the application's terms of service.
      Specified by:
      getTermsOfServiceUrl in interface ApplicationInfo
      Returns:
      The URL for the application's terms of service or null if none is set
    • getPrivacyPolicyUrl

      public String getPrivacyPolicyUrl()
      Description copied from interface: ApplicationInfo
      The URL for the application's privacy policy.
      Specified by:
      getPrivacyPolicyUrl in interface ApplicationInfo
      Returns:
      The URL for the application's privacy policy or null if none is set
    • getIconId

      public String 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 interface ApplicationInfo
      Returns:
      The icon id of the bot's application or null if no icon is defined
    • getIconUrl

      public String 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 interface ApplicationInfo
      Returns:
      The icon-url of the bot's application or null if no icon is defined
    • getTeam

      @Nonnull public ApplicationTeam getTeam()
      Description copied from interface: ApplicationInfo
      The team information for this application.
      Specified by:
      getTeam in interface ApplicationInfo
      Returns:
      The ApplicationTeam, or null if this application is not in a team.
    • setRequiredScopes

      @Nonnull public ApplicationInfo setRequiredScopes(@Nonnull Collection<String> scopes)
      Description copied from interface: ApplicationInfo
      Configures the required scopes applied to the ApplicationInfo.getInviteUrl(Permission...) and similar methods.
      The scope "bot" is always applied.
      Specified by:
      setRequiredScopes in interface ApplicationInfo
      Parameters:
      scopes - The scopes to use with ApplicationInfo.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 interface ISnowflake
      Returns:
      Long containing the Id.
    • getInviteUrl

      @Nonnull public String getInviteUrl(String guildId, Collection<Permission> permissions)
      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 interface ApplicationInfo
      Parameters:
      guildId - The id of the pre-selected guild.
      permissions - Possibly empty Collection of Permissions that should be requested via invite.
      Returns:
      The link used to invite the bot
    • getJDA

      @Nonnull public JDA getJDA()
      Description copied from interface: ApplicationInfo
      The JDA instance of this ApplicationInfo (the one logged into this application's bot account).
      Specified by:
      getJDA in interface ApplicationInfo
      Returns:
      The JDA instance of this ApplicationInfo
    • getName

      @Nonnull public String 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 interface ApplicationInfo
      Returns:
      The name of the bot's application.
    • getOwner

      @Nonnull public User getOwner()
      Description copied from interface: ApplicationInfo
      The owner of the bot's application.
      Specified by:
      getOwner in interface ApplicationInfo
      Returns:
      The owner of the bot's application
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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 interface ApplicationInfo
      Returns:
      Whether the bot is public
    • getTags

      @Nonnull public List<String> getTags()
      Description copied from interface: ApplicationInfo
      A List 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 interface ApplicationInfo
      Returns:
      Immutable list containing the tags of this bot's application
    • getRedirectUris

      @Nonnull public List<String> getRedirectUris()
      Description copied from interface: ApplicationInfo
      A List 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 interface ApplicationInfo
      Returns:
      Immutable list containing the OAuth2 redirect URIs of this bot's application
    • getInteractionsEndpointUrl

      @Nullable public String 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 interface ApplicationInfo
      Returns:
      Interaction endpoint URL of this bot's application, or null if it has not been set
    • getRoleConnectionsVerificationUrl

      @Nullable public String 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 interface ApplicationInfo
      Returns:
      Role connections verification URL of this bot's application, or null if it has not been set
    • getCustomAuthorizationUrl

      @Nullable public String 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 interface ApplicationInfo
      Returns:
      Custom Authorization URL, or null if it has not been set
    • getPermissions

      @Nonnull public EnumSet<Permission> getPermissions()
      Description copied from interface: ApplicationInfo
      An EnumSet 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 interface ApplicationInfo
      Returns:
      Set of permissions the default authorization URL is set up with.
    • getPermissionsRaw

      public long getPermissionsRaw()
      Description copied from interface: ApplicationInfo
      The long representation of the literal permissions the default authorization URL is set up with.
      Specified by:
      getPermissionsRaw in interface ApplicationInfo
      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 interface ApplicationInfo
      Returns:
      The bitset
    • getScopes

      @Nonnull public List<String> getScopes()
      Description copied from interface: ApplicationInfo
      A List 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 interface ApplicationInfo
      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 interface ApplicationInfo
      Returns:
      The approximate count of users that have installed this application.
    • getIntegrationTypesConfig

      Description copied from interface: ApplicationInfo
      The configurations for each IntegrationType set on the application.
      Specified by:
      getIntegrationTypesConfig in interface ApplicationInfo
      Returns:
      The configurations for each integration type
    • toString

      public String toString()
      Overrides:
      toString in class Object