File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
java/com/bencodez/votingplugin Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,14 @@ public class Config extends YMLFile {
8080 @ Getter
8181 private long discordSRVTopVoterChannel = 0 ;
8282
83+ @ ConfigDataString (path = "DiscordSRV.TopVoter.Title" )
84+ @ Getter
85+ private String discordSRVTopVoterTitle = "&3Top Voters of the Month" ;
86+
87+ @ ConfigDataString (path = "DiscordSRV.TopVoter.RankDisplay" )
88+ @ Getter
89+ private String discordSRVTopVoterRankDisplay = "&c%rank%: &6%player% - %votes% Votes" ;
90+
8391 @ ConfigDataBoolean (path = "AllowUnJoinedCheckServer" )
8492 @ Getter
8593 private boolean allowUnJoinedCheckServer = true ;
Original file line number Diff line number Diff line change @@ -83,15 +83,20 @@ public void updateDiscordLeaderboard() {
8383 long channelId = plugin .getConfigFile ().getDiscordSRVTopVoterChannel ();
8484 LinkedHashMap <TopVoterPlayer , Integer > topVoters = plugin .getTopVoter (TopVoter .Monthly );
8585
86- EmbedBuilder eb = new EmbedBuilder ().setTitle ("Top Voters This Month" ).setColor (Color .CYAN )
87- .setTimestamp (Instant .now ());
86+ String title = plugin .getConfigFile ().getDiscordSRVTopVoterTitle ();
87+ String rankDisplay = plugin .getConfigFile ().getDiscordSRVTopVoterRankDisplay ();
88+
89+ EmbedBuilder eb = new EmbedBuilder ().setTitle (title ).setColor (Color .CYAN ).setTimestamp (Instant .now ());
8890
8991 int rank = 1 ;
9092 for (Entry <TopVoterPlayer , Integer > entry : topVoters .entrySet ()) {
9193 if (rank > 10 )
9294 break ;
93- eb .addField ("#" + rank ++ + " " + entry .getKey ().getPlayerName (), entry .getValue ().intValue () + " votes" ,
94- false );
95+ String line = rankDisplay .replace ("%rank%" , String .valueOf (rank ))
96+ .replace ("%player%" , entry .getKey ().getPlayerName ())
97+ .replace ("%votes%" , String .valueOf (entry .getValue ()));
98+ eb .addField ("" , line , false );
99+ rank ++;
95100 }
96101
97102 TextChannel channel = DiscordUtil .getJda ().getTextChannelById (channelId );
Original file line number Diff line number Diff line change @@ -628,7 +628,10 @@ DiscordSRV:
628628 Enabled : false
629629
630630 # DiscordSRV channel to send messages to
631- Channel : 1234565 # Replace with your channel ID
631+ Channel : 1234565 # Replace with your channel ID
632+
633+ Title : ' &3Top Voters of the Month'
634+ RankDisplay : ' &c%rank%: &6%player% - %votes% Votes'
632635
633636
634637
You can’t perform that action at this time.
0 commit comments