Skip to content

Commit

Permalink
Add DisableReminders placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Dec 3, 2023
1 parent 579844f commit 4a77c6b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2049,6 +2049,8 @@ public void execute(CommandSender sender, String[] args) {
value = !plugin.getVoteReminding().getRemindersEnabled().get(p.getUniqueId());
}
plugin.getVoteReminding().getRemindersEnabled().put(p.getUniqueId(), value);
plugin.getPlaceholders().onUpdate(
plugin.getVotingPluginUserManager().getVotingPluginUser(p.getUniqueId(), p.getName()), true);

if (value) {
sendMessage(sender, plugin.getConfigFile().getFormatCommandsVoteToggleRemindersEnabled());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,20 @@ public String placeholderRequest(VotingPluginUser user, String identifier) {
}
}.withDescription("Returns true/false if user has broadcast disabled").updateDataKey("DisableBroadcast"));

placeholders.add(new PlaceHolder<VotingPluginUser>("DisableReminders") {

@Override
public String placeholderRequest(VotingPluginUser user, String identifier) {
if (plugin.getVoteReminding().getRemindersEnabled().containsKey(user.getJavaUUID())) {
if (!plugin.getVoteReminding().getRemindersEnabled().get(user.getJavaUUID()).booleanValue()) {

return "True";
}
}
return "False";
}
}.withDescription("Returns true/false if user has reminders disabled"));

placeholders.add(new PlaceHolder<VotingPluginUser>("MilestoneCount") {

@Override
Expand Down

0 comments on commit 4a77c6b

Please sign in to comment.