Skip to content

Commit

Permalink
feat: sends game winners message to discord (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagogebrimm authored Jan 23, 2023
1 parent 654b55e commit 64359d9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ protected void processWinners() {
SoundUtils.playSound(VICTORY, plugin.getConfig(), winners);
givePrizes(FIRST, winnerGroup, winners);
broadcastKey("who_won", winnerName, getLoserName());
discordAnnounce("discord_who_won", winnerName, getLoserName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ protected void processWinners() {
}
broadcastKey("who_won_tournament", getWinnerName(firstPlaceWinners),
getWinnerName(secondPlaceWinners), getWinnerName(thirdPlaceWinners));
discordAnnounce("discord_who_won_tournament", getWinnerName(firstPlaceWinners),
getWinnerName(secondPlaceWinners), getWinnerName(thirdPlaceWinners));
firstPlaceWinners.forEach(warrior -> warrior.increaseVictories(getConfig().getName()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ protected void processWinners() {
today.setWinners(gameName, Helper.warriorListToUuidList(winners));
String winnerName = getConfig().isGroupMode() ? winnerGroup.getName() : winners.get(0).getName();
broadcastKey("who_won", winnerName);
discordAnnounce("discord_who_won", winnerName);
winners.forEach(w -> w.increaseVictories(gameName));
givePrizes(FIRST, winnerGroup, winners);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/language-en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ error-saving-config: "&c» Error saving config!"
challenge_starting_game: " \n&b» Starting challenge in {0} seconds! \n» Needed: {1} groups, {2} players\n» Participating: {3} groups, {4} players.\n "
starting_game: "!!broadcast \n&b» Starting game in {0} seconds! Join using /tb join.\n» Needed: {1} groups, {2} players\n» Participating: {3} groups, {4} players.\n "
discord_game_starting: "» The countdown to a new game has started! \nJoin the server to participate."
discord_who_won: "» Game over! Winner group is: {0}."
discord_who_won_tournament: "» Game over! Winners are:\n &b1# &f{0}\n &b2# &f{1}\n &b3# &f{2}."
players-ranking:
victories-title: "V"
kills-title: "K"
Expand Down

0 comments on commit 64359d9

Please sign in to comment.