Commit b3ee2e3 1 parent a707900 commit b3ee2e3 Copy full SHA for b3ee2e3
File tree 1 file changed +16
-1
lines changed
src/main/java/eu/pabl/twitchchat/twitch_integration
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 {
117
117
118
118
@ Override
119
119
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
+ }
121
136
}
122
137
123
138
@ Override
You can’t perform that action at this time.
0 commit comments