Skip to content

Commit

Permalink
Start embed color to white, finish embed color to winner color
Browse files Browse the repository at this point in the history
  • Loading branch information
TBG1000 committed Jul 23, 2022
1 parent a7ce44a commit 9ad241d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/main/java/me/tbg/match/bot/MatchFinishListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,21 @@ public void onMatchFinish(MatchFinishEvent event) {
Collection<Competitor> teams = match.getCompetitors();

String winner = "";
for (Competitor competitor : match.getCompetitors()) {
Color winnerColor = null;
for (Competitor competitor : teams) {
if (event.getWinners().contains(competitor)) {
if (event.getWinners().size() == 1) {
winner = competitor.getNameLegacy();
winnerColor = new Color(competitor.getFullColor().asRGB());
} else {
winner = "Tie";
winnerColor = Color.RED;
}
}
}
EmbedBuilder matchInfo =
new EmbedBuilder()
.setColor(Color.RED)
.setColor(winnerColor)
.setTitle("Match #" + match.getId() + " has finished!")
.setThumbnail(bot.getMapImageUrl(map))
.setDescription(
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/tbg/match/bot/MatchStartListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void onMatchStart(MatchStartEvent event) {
MapInfo map = match.getMap();
EmbedBuilder matchStartEmbed =
new EmbedBuilder()
.setColor(Color.GREEN)
.setColor(Color.WHITE)
.setTitle("Match #" + match.getId() + " has started!")
.setThumbnail(bot.getMapImageUrl(map))
.setDescription(
Expand Down

0 comments on commit 9ad241d

Please sign in to comment.