diff --git a/src/main/java/net/dv8tion/jda/api/entities/ApplicationInfo.java b/src/main/java/net/dv8tion/jda/api/entities/ApplicationInfo.java
index 68bbc00562..0452e07812 100644
--- a/src/main/java/net/dv8tion/jda/api/entities/ApplicationInfo.java
+++ b/src/main/java/net/dv8tion/jda/api/entities/ApplicationInfo.java
@@ -22,8 +22,7 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import java.util.Arrays;
-import java.util.Collection;
+import java.util.*;
/**
* Represents a Discord Application from its bot's point of view.
@@ -287,4 +286,51 @@ default String getInviteUrl(long guildId, @Nullable Permission... permissions)
* @return Whether the bot is public
*/
boolean isBotPublic();
+
+ /**
+ * A {@link java.util.List} containing the tags of this bot's application.
+ *
+ *
This List is empty if no tags are set in the Developer Portal.
+ *
+ * @return Immutable list containing the tags of this bot's application
+ */
+ @Nonnull
+ List getTags();
+
+ /**
+ * The custom Authorization URL of this bot's application.
+ *
+ * This returns {@code null} if no custom URL is set in the Developer Portal or if In-app Authorization is enabled.
+ *
+ * @return Custom Authorization URL, or null if it has not been set
+ */
+ @Nullable
+ String getCustomAuthorizationUrl();
+
+ /**
+ * A {@link java.util.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.
+ *
+ * @return Immutable list of scopes the default authorization URL is set up with.
+ */
+ @Nonnull
+ List getScopes();
+
+ /**
+ * An {@link java.util.EnumSet} of permissions the default authorization URL is set up with.
+ *
+ * This is empty if you set a custom URL in the Developer Portal.
+ *
+ * @return Set of permissions the default authorization URL is set up with.
+ */
+ @Nonnull
+ EnumSet getPermissions();
+
+ /**
+ * The {@code long} representation of the literal permissions the default authorization URL is set up with.
+ *
+ * @return Never-negative long containing offset permissions the default authorization URL is set up with.
+ */
+ long getPermissionsRaw();
}
diff --git a/src/main/java/net/dv8tion/jda/internal/entities/ApplicationInfoImpl.java b/src/main/java/net/dv8tion/jda/internal/entities/ApplicationInfoImpl.java
index be1db12715..3bc78f4dc7 100644
--- a/src/main/java/net/dv8tion/jda/internal/entities/ApplicationInfoImpl.java
+++ b/src/main/java/net/dv8tion/jda/internal/entities/ApplicationInfoImpl.java
@@ -24,7 +24,11 @@
import net.dv8tion.jda.internal.utils.Checks;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.List;
public class ApplicationInfoImpl implements ApplicationInfo
{
@@ -40,10 +44,15 @@ public class ApplicationInfoImpl implements ApplicationInfo
private final String name;
private final User owner;
private final ApplicationTeam team;
+ private final List tags;
+ private final String customAuthUrl;
+ private final long defaultAuthUrlPerms;
+ private final List defaultAuthUrlScopes;
private String scopes = "bot";
public ApplicationInfoImpl(JDA api, String description, boolean doesBotRequireCodeGrant, String iconId, long id,
- boolean isBotPublic, String name, String termsOfServiceUrl, String privacyPolicyUrl, User owner, ApplicationTeam team)
+ boolean isBotPublic, String name, String termsOfServiceUrl, String privacyPolicyUrl, User owner, ApplicationTeam team,
+ List tags, String customAuthUrl, long defaultAuthUrlPerms, List defaultAuthUrlScopes)
{
this.api = api;
this.description = description;
@@ -56,6 +65,10 @@ public ApplicationInfoImpl(JDA api, String description, boolean doesBotRequireCo
this.privacyPolicyUrl = privacyPolicyUrl;
this.owner = owner;
this.team = team;
+ this.tags = Collections.unmodifiableList(tags);
+ this.customAuthUrl = customAuthUrl;
+ this.defaultAuthUrlPerms = defaultAuthUrlPerms;
+ this.defaultAuthUrlScopes = Collections.unmodifiableList(defaultAuthUrlScopes);
}
@Override
@@ -184,6 +197,40 @@ public final boolean isBotPublic()
return this.isBotPublic;
}
+ @Nonnull
+ @Override
+ public List getTags()
+ {
+ return tags;
+ }
+
+ @Nullable
+ @Override
+ public String getCustomAuthorizationUrl()
+ {
+ return customAuthUrl;
+ }
+
+ @Nonnull
+ @Override
+ public EnumSet getPermissions()
+ {
+ return Permission.getPermissions(defaultAuthUrlPerms);
+ }
+
+ @Override
+ public long getPermissionsRaw()
+ {
+ return defaultAuthUrlPerms;
+ }
+
+ @Nonnull
+ @Override
+ public List getScopes()
+ {
+ return defaultAuthUrlScopes;
+ }
+
@Override
public String toString()
{
diff --git a/src/main/java/net/dv8tion/jda/internal/entities/EntityBuilder.java b/src/main/java/net/dv8tion/jda/internal/entities/EntityBuilder.java
index a9700a8565..3e6b387f2c 100644
--- a/src/main/java/net/dv8tion/jda/internal/entities/EntityBuilder.java
+++ b/src/main/java/net/dv8tion/jda/internal/entities/EntityBuilder.java
@@ -2124,9 +2124,23 @@ public ApplicationInfo createApplicationInfo(DataObject object)
final boolean isBotPublic = object.getBoolean("bot_public");
final User owner = createUser(object.getObject("owner"));
final ApplicationTeam team = !object.isNull("team") ? createApplicationTeam(object.getObject("team")) : null;
+ final String customAuthUrl = object.getString("custom_install_url", null);
+ final List tags = object.optArray("tags").orElseGet(DataArray::empty)
+ .stream(DataArray::getString)
+ .collect(Collectors.toList());
+
+ final Optional installParams = object.optObject("install_params");
+
+ final long defaultAuthUrlPerms = installParams.map(o -> o.getLong("permissions"))
+ .orElse(0L);
+
+ final List defaultAuthUrlScopes = installParams.map(obj -> obj.getArray("scopes")
+ .stream(DataArray::getString)
+ .collect(Collectors.toList()))
+ .orElse(Collections.emptyList());
return new ApplicationInfoImpl(getJDA(), description, doesBotRequireCodeGrant, iconId, id, isBotPublic, name,
- termsOfServiceUrl, privacyPolicyUrl, owner, team);
+ termsOfServiceUrl, privacyPolicyUrl, owner, team, tags, customAuthUrl, defaultAuthUrlPerms, defaultAuthUrlScopes);
}
public ApplicationTeam createApplicationTeam(DataObject object)