From 0fb0ab59bf68091f577ce911e728727ecd2478e0 Mon Sep 17 00:00:00 2001 From: Axel Joly Date: Tue, 26 Mar 2024 23:24:09 -0400 Subject: [PATCH] feat: added fields related to user-installed applications (#162) * feat: added fields related to user-installed applications * fix: added missing fields for command creation * fix: added deprecation notice and replacement --- .../discordjson/json/ApplicationCommandData.java | 9 +++++++++ .../discordjson/json/ApplicationCommandRequest.java | 6 ++++++ .../java/discord4j/discordjson/json/InteractionData.java | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/src/main/java/discord4j/discordjson/json/ApplicationCommandData.java b/src/main/java/discord4j/discordjson/json/ApplicationCommandData.java index 1a77ed16..afafffb9 100644 --- a/src/main/java/discord4j/discordjson/json/ApplicationCommandData.java +++ b/src/main/java/discord4j/discordjson/json/ApplicationCommandData.java @@ -70,8 +70,11 @@ static ImmutableApplicationCommandData.Builder builder() { /** * whether the command is enabled in DM by default when the app is added globally (default to true) + * + * @deprecated use {@link #contexts()} instead */ @JsonProperty("dm_permission") + @Deprecated Possible dmPermission(); /** @@ -86,4 +89,10 @@ static ImmutableApplicationCommandData.Builder builder() { */ @JsonProperty("default_member_permissions") Optional defaultMemberPermissions(); + + @JsonProperty("integration_types") + List integrationTypes(); + + @JsonProperty("contexts") + List contexts(); } diff --git a/src/main/java/discord4j/discordjson/json/ApplicationCommandRequest.java b/src/main/java/discord4j/discordjson/json/ApplicationCommandRequest.java index c288d626..fd35434a 100644 --- a/src/main/java/discord4j/discordjson/json/ApplicationCommandRequest.java +++ b/src/main/java/discord4j/discordjson/json/ApplicationCommandRequest.java @@ -59,4 +59,10 @@ static ImmutableApplicationCommandRequest.Builder builder() { * value of ApplicationCommandType (defaults to 1, CHAT_INPUT) */ Possible type(); + + @JsonProperty("integration_types") + Possible> integrationTypes(); + + @JsonProperty("contexts") + Possible> contexts(); } diff --git a/src/main/java/discord4j/discordjson/json/InteractionData.java b/src/main/java/discord4j/discordjson/json/InteractionData.java index 2fb26512..35f81556 100644 --- a/src/main/java/discord4j/discordjson/json/InteractionData.java +++ b/src/main/java/discord4j/discordjson/json/InteractionData.java @@ -8,6 +8,7 @@ import org.immutables.value.Value; import java.util.List; +import java.util.Map; @Value.Immutable @JsonSerialize(as = ImmutableInteractionData.class) @@ -69,4 +70,9 @@ static ImmutableInteractionData.Builder builder() { @JsonProperty("entitlements") List entitlements(); + + @JsonProperty("authorizing_integration_owners") + Map authorizingIntegrationOwners(); + + Possible context(); }