Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement new beta helix chat endpoints (#606)
* chore: add new scopes * feat: implement TwitchHelix#sendWhisper * feat: implement TwitchHelix#sendChatAnnouncement * feat: implement TwitchHelix#deleteChatMessages * feat: implement TwitchHelix#updateUserChatColor * feat: implement TwitchHelix#addChannelModerator * feat: implement TwitchHelix#addChannelModerator * feat: implement TwitchHelix#addChannelVip * feat: implement TwitchHelix#removeChannelVip * feat: implement TwitchHelix#getChannelVips * feat: implement TwitchHelix#getUserChatColor * feat: rate limit TwitchHelix#sendWhisper * feat: rate limit add & remove mod endpoints * feat: rate limit add & remove vip endpoints * fix: separate add/remove mod/vip buckets * feat: add nullable annotations on added methods Co-authored-by: Philipp Heuer <git@philippheuer.me>
- Loading branch information
1 parent
d119698
commit 2405187
Showing
11 changed files
with
543 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
254 changes: 254 additions & 0 deletions
254
rest-helix/src/main/java/com/github/twitch4j/helix/TwitchHelix.java
Large diffs are not rendered by default.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
rest-helix/src/main/java/com/github/twitch4j/helix/domain/AnnouncementColor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.github.twitch4j.helix.domain; | ||
|
||
/** | ||
* The color used to highlight the announcement. | ||
*/ | ||
public enum AnnouncementColor { | ||
BLUE, | ||
GREEN, | ||
ORANGE, | ||
PURPLE, | ||
PRIMARY; | ||
|
||
@Override | ||
public String toString() { | ||
return this.name().toLowerCase(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
rest-helix/src/main/java/com/github/twitch4j/helix/domain/ChannelVip.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.github.twitch4j.helix.domain; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.Setter; | ||
|
||
@Data | ||
@Setter(AccessLevel.PRIVATE) | ||
public class ChannelVip { | ||
|
||
/** | ||
* An ID that uniquely identifies the VIP user. | ||
*/ | ||
private String userId; | ||
|
||
/** | ||
* The user’s display name. | ||
*/ | ||
private String userName; | ||
|
||
/** | ||
* The user’s login name. | ||
*/ | ||
private String userLogin; | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
rest-helix/src/main/java/com/github/twitch4j/helix/domain/ChannelVipList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.github.twitch4j.helix.domain; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Setter(AccessLevel.PRIVATE) | ||
public class ChannelVipList { | ||
|
||
/** | ||
* The list of VIPs. | ||
* <p> | ||
* The list is empty if the channel doesn't have VIP users. | ||
* The list does not include the broadcaster. | ||
*/ | ||
private List<ChannelVip> data; | ||
|
||
/** | ||
* Contains the information used to page through the list of results. | ||
*/ | ||
private HelixPagination pagination; | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
rest-helix/src/main/java/com/github/twitch4j/helix/domain/ChatUserColor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.github.twitch4j.helix.domain; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.Setter; | ||
|
||
@Data | ||
@Setter(AccessLevel.PRIVATE) | ||
public class ChatUserColor { | ||
|
||
/** | ||
* The ID of the user. | ||
*/ | ||
private String userId; | ||
|
||
/** | ||
* The user’s display name. | ||
*/ | ||
private String userName; | ||
|
||
/** | ||
* The user’s login name. | ||
*/ | ||
private String userLogin; | ||
|
||
/** | ||
* The Hex color code that the user uses in chat for their name. | ||
* <p> | ||
* If the user hasn't specified a color in their settings, the string is empty. | ||
*/ | ||
private String color; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
rest-helix/src/main/java/com/github/twitch4j/helix/domain/NamedUserChatColor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.twitch4j.helix.domain; | ||
|
||
/** | ||
* The color to use for the user’s name in chat. | ||
* <p> | ||
* All users may specify one of the following named color values. | ||
* <p> | ||
* Turbo and Prime users may specify a named color or a Hex color code like #9146FF. | ||
* If you use a Hex color code, remember to URL encode it. | ||
* | ||
* @see com.github.twitch4j.helix.TwitchHelix#updateUserChatColor(String, String, String) | ||
*/ | ||
public enum NamedUserChatColor { | ||
BLUE, | ||
BLUE_VIOLET, | ||
CADET_BLUE, | ||
CHOCOLATE, | ||
CORAL, | ||
DODGER_BLUE, | ||
FIREBRICK, | ||
GOLDEN_ROD, | ||
GREEN, | ||
HOT_PINK, | ||
ORANGE_RED, | ||
RED, | ||
SEA_GREEN, | ||
SPRING_GREEN, | ||
YELLOW_GREEN; | ||
|
||
@Override | ||
public String toString() { | ||
return this.name().toLowerCase(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
rest-helix/src/main/java/com/github/twitch4j/helix/domain/UserChatColorList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.github.twitch4j.helix.domain; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Data; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@Setter(AccessLevel.PRIVATE) | ||
public class UserChatColorList { | ||
|
||
/** | ||
* The list of users and the color code that’s used for their name. | ||
*/ | ||
private List<ChatUserColor> data; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.