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

feat: add custom tags to helix responses #702

Merged
merged 2 commits into from Jan 11, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -8,6 +8,8 @@
import lombok.With;
import org.jetbrains.annotations.Nullable;

import java.util.List;

@Data
@With
@Setter(AccessLevel.PRIVATE)
Expand Down Expand Up @@ -56,8 +58,22 @@ public class ChannelInformation {
* Stream delay in seconds.
* <p>
* Stream delay is a Twitch Partner feature; trying to set this value for other account types will return a 400 error.
* <p>
* Note: this can only be returned if using the broadcaster's user access toke
*/
@Nullable
private Integer delay;

/**
* A list of channel-defined tags to apply to the channel.
* <p>
* A channel may specify a maximum of 10 tags.
* Each tag is limited to a maximum of 25 characters and may not be an empty string or contain spaces or special characters.
* Tags are case-insensitive. For readability, consider using camelCasing or PascalCasing.
* <p>
* For {@link com.github.twitch4j.helix.TwitchHelix#updateChannelInformation(String, String, ChannelInformation)},
* setting this to an empty list <a href="https://github.com/twitchdev/issues/issues/708">should</a> result in all tags being removed from the channel.
*/
private List<String> tags;

}
Expand Up @@ -6,6 +6,7 @@
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import org.jetbrains.annotations.Nullable;

import java.time.Instant;
import java.util.List;
Expand Down Expand Up @@ -57,10 +58,20 @@ public class ChannelSearchResult {
* Note: Category Tags are not returned
*
* @see <a href="https://www.twitch.tv/directory/all/tags">Tag types</a>
* @deprecated Twitch is deprecating this field and will stop providing IDs in 2023 (Twitch will communicate the specific date in early 2023) in favor of {@link #getTags()}
*/
@Nullable
@Deprecated
@JsonProperty("tag_ids")
private List<String> tagsIds;

/**
* The tags applied to the channel.
* <p>
* Note: Unlike {@link #getTagsIds()}, these tags <i>are</i> returned for offline channels
*/
private List<String> tags;

/**
* Thumbnail URL of the stream
*/
Expand Down
Expand Up @@ -9,6 +9,7 @@
import lombok.NonNull;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.Nullable;

import java.time.Duration;
import java.time.Instant;
Expand Down Expand Up @@ -49,6 +50,7 @@ public class Stream {
private String gameName;

/** Array of community IDs. */
@Nullable
@Deprecated
private List<UUID> communityIds;

Expand All @@ -60,6 +62,9 @@ public class Stream {
@NonNull
private String title;

/** The tags applied to the stream. */
private List<String> tags;

/** Number of viewers watching the stream at the time of the query. */
@NonNull
private Integer viewerCount;
Expand All @@ -69,7 +74,13 @@ public class Stream {
@JsonProperty("started_at")
private Instant startedAtInstant;

/** Ids of active tags on the stream */
/**
* Ids of active tags on the stream
*
* @deprecated Twitch is deprecating this field and will stop providing IDs in 2023 (Twitch will communicate the specific date in early 2023) in favor of {@link #getTags()}
*/
@Nullable
@Deprecated
private List<UUID> tagIds = new ArrayList<>();

/** Indicates if the broadcaster has specified their channel contains mature content that may be inappropriate for younger audiences. */
Expand Down