diff --git a/common/src/main/java/com/discordsrv/common/config/configurate/manager/abstraction/ConfigurateConfigManager.java b/common/src/main/java/com/discordsrv/common/config/configurate/manager/abstraction/ConfigurateConfigManager.java index 20d9016f..5204620b 100644 --- a/common/src/main/java/com/discordsrv/common/config/configurate/manager/abstraction/ConfigurateConfigManager.java +++ b/common/src/main/java/com/discordsrv/common/config/configurate/manager/abstraction/ConfigurateConfigManager.java @@ -35,6 +35,7 @@ import com.discordsrv.common.config.main.channels.base.IChannelConfig; import com.discordsrv.common.exception.ConfigException; import com.discordsrv.common.logging.Logger; import com.discordsrv.common.logging.NamedLogger; +import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.Nullable; import org.spongepowered.configurate.*; import org.spongepowered.configurate.loader.AbstractConfigurationLoader; @@ -55,6 +56,7 @@ import java.lang.reflect.Type; import java.nio.file.Path; import java.util.*; import java.util.regex.Pattern; +import java.util.stream.Collectors; public abstract class ConfigurateConfigManager> implements ConfigManager, ConfigLoaderProvider { @@ -213,11 +215,16 @@ public abstract class ConfigurateConfigManager (value, destination) -> { diff --git a/common/src/main/java/com/discordsrv/common/config/connection/UpdateConfig.java b/common/src/main/java/com/discordsrv/common/config/connection/UpdateConfig.java index 435f8e84..c1efd50e 100644 --- a/common/src/main/java/com/discordsrv/common/config/connection/UpdateConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/connection/UpdateConfig.java @@ -32,15 +32,15 @@ public class UpdateConfig { public boolean notificationEnabled = true; @Setting(value = "notification-ingame") - @Constants.Comment("discordsrv.updatenotification") @Comment("If players with the %1 permission should receive\n" + "a update notification upon joining if there is a update available") + @Constants.Comment("discordsrv.updatenotification") public boolean notificationInGame = true; @Setting(value = "enable-first-party-api-for-notifications") - @Constants.Comment(UpdateChecker.DOWNLOAD_SERVICE_DOMAIN) @Comment("Whether the DiscordSRV download API should be used for update checks\n" + "Requires a connection to: %1") + @Constants.Comment(UpdateChecker.DOWNLOAD_SERVICE_DOMAIN) public boolean firstPartyNotification = true; @Setting(value = "github") @@ -53,17 +53,17 @@ public class UpdateConfig { public static class GitHub { @Setting(value = "enabled") - @Constants.Comment(UpdateChecker.GITHUB_API_DOMAIN) @Comment("Whether the GitHub API should be used for update checks\n" + "This will be the secondary API if both first party and GitHub sources are enabled\n" + "Requires a connection to: %1") + @Constants.Comment(UpdateChecker.GITHUB_API_DOMAIN) public boolean enabled = true; @Setting(value = "api-token") - @Constants.Comment(UpdateChecker.GITHUB_REPOSITORY) @Comment("The GitHub API token used for authenticating to the GitHub api,\n" + "if this isn't specified the API will be used 'anonymously'\n" + "The token only requires read permission to %1 releases, workflows and commits") + @Constants.Comment(UpdateChecker.GITHUB_REPOSITORY) public String apiToken = ""; } @@ -72,12 +72,12 @@ public class UpdateConfig { public static class Security { @Setting(value = "enabled") - @Constants.Comment(UpdateChecker.DOWNLOAD_SERVICE_DOMAIN) @Comment("Uses the DiscordSRV download API to check if the version of DiscordSRV\n" + "being used is vulnerable to known vulnerabilities, disabling the plugin if it is.\n" + "Requires a connection to: %1\n" + "\n" + "WARNING! DO NOT TURN THIS OFF UNLESS YOU KNOW WHAT YOU'RE DOING AND STAY UP-TO-DATE") + @Constants.Comment(UpdateChecker.DOWNLOAD_SERVICE_DOMAIN) public boolean enabled = true; @Setting(value = "force") diff --git a/common/src/main/java/com/discordsrv/common/config/main/TimedUpdaterConfig.java b/common/src/main/java/com/discordsrv/common/config/main/TimedUpdaterConfig.java index cb5ffda4..fdee5099 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/TimedUpdaterConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/TimedUpdaterConfig.java @@ -59,8 +59,8 @@ public class TimedUpdaterConfig { @Comment("The format for the channel name(s), placeholders are supported.") public String nameFormat = ""; - @Constants.Comment(intValue = MINIMUM_MINUTES) @Comment("The time between updates in minutes. The minimum time is %1 minutes.") + @Constants.Comment(intValue = MINIMUM_MINUTES) public int timeMinutes = MINIMUM_MINUTES; @Override @@ -95,8 +95,8 @@ public class TimedUpdaterConfig { + "If this is blank, the topic will not be updated") public String topicFormat = ""; - @Constants.Comment(intValue = MINIMUM_MINUTES) @Comment("The time between updates in minutes. The minimum time is %1 minutes.") + @Constants.Comment(intValue = MINIMUM_MINUTES) public int timeMinutes = MINIMUM_MINUTES; @Override diff --git a/common/src/main/java/com/discordsrv/common/config/main/linking/RequirementsConfig.java b/common/src/main/java/com/discordsrv/common/config/main/linking/RequirementsConfig.java index f1f21fd8..4f28887f 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/linking/RequirementsConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/linking/RequirementsConfig.java @@ -55,7 +55,8 @@ public class RequirementsConfig { + "\n" + "The following operators are available:\n" + "&& = and, for example: \"DiscordServer(...) && TwitchFollower()\"\n" - + "|| = or, for example \"DiscordBoosting(...) || YouTubeMember()\n" - + "You can also use brackets () to clear ambiguity, for example: \"DiscordServer(...) && (TwitchSubscriber() || PatreonSubscriber())\"") + + "|| = or, for example \"DiscordBoosting(...) || YouTubeMember()\"\n" + + "You can also use brackets () to clear ambiguity, for example: \"DiscordServer(...) && (TwitchSubscriber() || PatreonSubscriber())\"\n" + + "allows a member of the specified Discord server that is also a twitch or patreon subscriber to join the server") public List requirements = new ArrayList<>(); }