Class ApplicationInfo

java.lang.Object
discord4j.core.object.entity.ApplicationInfo
All Implemented Interfaces:
DiscordObject, Entity

public final class ApplicationInfo extends Object implements Entity
Represents the Current (typically) Application Information.
See Also:
  • Constructor Details

    • ApplicationInfo

      public ApplicationInfo(GatewayDiscordClient gateway, discord4j.discordjson.json.ApplicationInfoData data)
      Constructs a ApplicationInfo with an associated GatewayDiscordClient and Discord data.
      Parameters:
      gateway - The GatewayDiscordClient associated to this object, must be non-null.
      data - The raw data as represented by Discord, must be non-null.
  • Method Details

    • getClient

      public GatewayDiscordClient getClient()
      Description copied from interface: DiscordObject
      Returns the GatewayDiscordClient that created this object. Methods in it are exclusively based on the entity cache or Store in use. Refer to calling getClient().rest() to access a DiscordClient that is capable of requesting entities directly from the REST API.
      Specified by:
      getClient in interface DiscordObject
      Returns:
      The GatewayDiscordClient associated to this object.
    • getId

      public Snowflake getId()
      Description copied from interface: Entity
      Gets the Snowflake that uniquely identifies this entity.
      Specified by:
      getId in interface Entity
      Returns:
      The Snowflake that uniquely identifies this entity.
    • getData

      public discord4j.discordjson.json.ApplicationInfoData getData()
      Gets the data of the app.
      Returns:
      The data of the app.
    • getName

      public String getName()
      Gets the name of the app.
      Returns:
      The name of the app.
    • getIconUrl

      public Optional<String> getIconUrl(Image.Format format)
      Gets the icon URL of the application, if present.
      Parameters:
      format - The format for the URL.
      Returns:
      The icon URL of the application, if present.
    • getIcon

      public Mono<Image> getIcon(Image.Format format)
      Gets the icon of the application.
      Parameters:
      format - The format in which to get the icon.
      Returns:
      A Mono where, upon successful completion, emits the icon of the application. If an error is received, it is emitted through the Mono.
    • getDescription

      public String getDescription()
      Gets the description of the app.
      Returns:
      The description of the app.
    • isPublic

      public boolean isPublic()
      Gets whether only the app owner can join the app's bot to guilds.
      Returns:
      true if only the app owner can join the app's bot to guilds, false otherwise.
    • requireCodeGrant

      public boolean requireCodeGrant()
      Gets whether the app's bot will only join upon completion of the full OAuth2 code grant flow.
      Returns:
      true if the app's bot will only join upon completion of the full OAuth2 code grant flow, false otherwise.
    • getTermsOfServiceUrl

      public Optional<String> getTermsOfServiceUrl()
      Gets the url of the app's terms of service, if present.
      Returns:
      The url of the app's terms of service, if present.
    • getPrivacyPolicyUrl

      public Optional<String> getPrivacyPolicyUrl()
      Gets the url of the app's privacy policy, if present.
      Returns:
      The url of the app's privacy policy, if present.
    • getOwnerId

      public Snowflake getOwnerId()
      Gets the ID of the owner of the application.
      Returns:
      The ID of the owner of the application.
    • getOwner

      public Mono<User> getOwner()
      Requests to retrieve the owner of the application.
      Returns:
      A Mono where, upon successful completion, emits the owner of the application. If an error is received, it is emitted through the Mono.
    • getOwner

      public Mono<User> getOwner(EntityRetrievalStrategy retrievalStrategy)
      Requests to retrieve the owner of the application, using the given retrieval strategy.
      Parameters:
      retrievalStrategy - The strategy to use to get the owner.
      Returns:
      A Mono where, upon successful completion, emits the owner of the application. If an error is received, it is emitted through the Mono.
    • getTeam

      public Optional<ApplicationTeam> getTeam()
      Gets the members of the application team, if the application belongs to a team.
      Returns:
      The members of the application's team, if the application belongs to a team.
    • getFlags

      public EnumSet<ApplicationInfo.Flag> getFlags()
      Returns the public flags of this ApplicationInfo.
      Returns:
      A EnumSet with the public flags of this application.
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object