File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/main/java/eu/pabl/twitchchat/twitch_integration Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,22 @@ public void onMessage(MessageEvent event) throws Exception {
117117
118118 @ Override
119119 public void onUnknown (UnknownEvent event ) throws Exception {
120- System .out .println ("UNKNOWN TWITCH EVENT: " + event .toString ());
120+ switch (event .getCommand ()) {
121+ case "USERSTATE" -> {
122+ // Info about our user. More at https://dev.twitch.tv/docs/irc/commands/#userstate
123+ // Set our correct colour :).
124+ String colorTag = event .getTags ().get ("color" );
125+ if (colorTag != null ) {
126+ Color userColor = Color .decode (colorTag );
127+ TextColor formattingColor = TextColor .fromRgb (userColor .getRGB ());
128+
129+ putFormattingColor (getUsername (), formattingColor );
130+ }
131+ }
132+ default -> {
133+ System .out .println ("UNKNOWN TWITCH EVENT: " + event .toString ());
134+ }
135+ }
121136 }
122137
123138 @ Override
You can’t perform that action at this time.
0 commit comments