Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update resolved data structure in application command interactions #161

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/main/java/discord4j/discordjson/json/ResolvedChannelData.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package discord4j.discordjson.json;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import discord4j.discordjson.Id;
import discord4j.discordjson.possible.Possible;
import org.immutables.value.Value;

import java.util.Optional;

@Value.Immutable
@JsonSerialize(as = ImmutableResolvedChannelData.class)
@JsonDeserialize(as = ImmutableResolvedChannelData.class)
Expand All @@ -15,10 +20,21 @@ static ImmutableResolvedChannelData.Builder builder() {

String id();

String name();
// This field can be given in a resolved channel data object, but it has the same properties as the channel object
Possible<Optional<String>> name();

int type();

String permissions();
// This field can be given in a resolved channel data object, but it has the same properties as the channel object
Possible<Optional<String>> permissions();

// Only provided if channel is a thread
@JsonProperty("thread_metadata")
Possible<ThreadMetadata> threadMetadata();

// Only provided if channel is a thread

@JsonProperty("parent_id")
Possible<Id> parentId();

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ static ImmutableResolvedMemberData.Builder builder() {

Possible<Optional<String>> nick();

Possible<Optional<String>> avatar();

List<String> roles();

@JsonProperty("joined_at")
Expand Down
Loading