diff --git a/sigIRCv2.jar b/sigIRCv2.jar index 03f0c88..054d81c 100644 Binary files a/sigIRCv2.jar and b/sigIRCv2.jar differ diff --git a/src/sig/modules/TwitchModule.java b/src/sig/modules/TwitchModule.java index 0f247a6..3312c44 100644 --- a/src/sig/modules/TwitchModule.java +++ b/src/sig/modules/TwitchModule.java @@ -220,6 +220,15 @@ public class TwitchModule extends Module{ .ofPattern("uuuu-MM-dd'T'HH:mm:ssz"); uptime = ZonedDateTime.parse(stream.getString("started_at"),DATE_TIME_FORMATTER); viewers_numb.updateValue(stream.getInt("viewer_count")); + //System.out.println(stream.getString("game_id")); + if (stream.getString("game_id").length()>0 && !stream.getString("game_id").equalsIgnoreCase("null")) { + int gameID = Integer.parseInt(stream.getString("game_id")); + FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/games?id="+gameID, "game_info",true); + JSONObject gameData = FileUtils.readJsonFromFile("game_info"); + currentlyPlaying = gameData.getJSONArray("data").getJSONObject(0).getString("name"); + } else { + currentlyPlaying = ""; + } } FileUtils.downloadFileFromUrl("https://api.twitch.tv/helix/users/follows?to_id="+sigIRC.channel_id, "temp_followers",true); JSONObject FollowerData = FileUtils.readJsonFromFile("temp_followers");