From 3b0ee1dd5afd1fedefd97aab9f6416e21c44d165 Mon Sep 17 00:00:00 2001 From: Vankka Date: Thu, 14 Nov 2024 22:45:36 +0200 Subject: [PATCH] Fix typos and improve language in the config --- .../discordsrv/common/config/main/AvatarProviderConfig.java | 2 +- .../java/com/discordsrv/common/config/main/DebugConfig.java | 2 +- .../discordsrv/common/config/main/DiscordCommandConfig.java | 6 ++++-- .../java/com/discordsrv/common/config/main/MainConfig.java | 1 + .../discordsrv/common/config/main/MessagesMainConfig.java | 2 +- .../discordsrv/common/config/main/TimedUpdaterConfig.java | 2 +- .../common/config/main/channels/JoinMessageConfig.java | 2 ++ .../common/config/main/channels/LeaveMessageConfig.java | 2 ++ .../common/config/main/channels/MirroringConfig.java | 2 +- .../main/generic/GameCommandExecutionConditionConfig.java | 2 +- .../common/config/main/linking/LinkedAccountConfig.java | 4 ++-- .../api/entity/message/ReceivedDiscordMessageImpl.java | 1 + 12 files changed, 18 insertions(+), 10 deletions(-) diff --git a/common/src/main/java/com/discordsrv/common/config/main/AvatarProviderConfig.java b/common/src/main/java/com/discordsrv/common/config/main/AvatarProviderConfig.java index 67ba4390..42f3d610 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/AvatarProviderConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/AvatarProviderConfig.java @@ -31,9 +31,9 @@ public class AvatarProviderConfig { public boolean autoDecideAvatarUrl = true; @Untranslated(Untranslated.Type.VALUE) - @Constants("auto-decide-avatar-url") @Comment("The template for URLs of player avatars\n" + "This will be used for official Java players only if %1 is set to true\n" + "This will be used ALWAYS if %1 is set to false") + @Constants.Comment("auto-decide-avatar-url") public String avatarUrlTemplate = "https://crafatar.com/avatars/%player_uuid_short%.png?size=128&overlay#%player_skin_texture_id%"; } diff --git a/common/src/main/java/com/discordsrv/common/config/main/DebugConfig.java b/common/src/main/java/com/discordsrv/common/config/main/DebugConfig.java index c6bcb2b2..c0646030 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/DebugConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/DebugConfig.java @@ -29,7 +29,7 @@ import java.util.Map; @ConfigSerializable public class DebugConfig { - @Comment("If debug messages should be logged into the config") + @Comment("If debug messages should be logged into the console") public boolean logToConsole = false; @Comment("Additional levels to log\nExample value: %1") diff --git a/common/src/main/java/com/discordsrv/common/config/main/DiscordCommandConfig.java b/common/src/main/java/com/discordsrv/common/config/main/DiscordCommandConfig.java index 433051c9..2b7a418c 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/DiscordCommandConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/DiscordCommandConfig.java @@ -55,7 +55,9 @@ public class DiscordCommandConfig { + "- ansi: A colored ansi code block\n" + "- plain: Plain text\n" + "- code_block: Plain code block\n" - + "- off: No command output") + + "- off: No command output\n" + + "\n" + + "Please note that some commands may not be work with output forwarding") public OutputMode outputMode = OutputMode.MARKDOWN; @Comment("At least one condition has to match to allow execution") @@ -66,7 +68,7 @@ public class DiscordCommandConfig { public boolean suggest = true; @Comment("If suggestions should be filtered based on the \"%1\" option") - @Constants.Comment("filters") + @Constants.Comment("execution-conditions") public boolean filterSuggestions = true; } diff --git a/common/src/main/java/com/discordsrv/common/config/main/MainConfig.java b/common/src/main/java/com/discordsrv/common/config/main/MainConfig.java index 29c39c14..eb950531 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/MainConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/MainConfig.java @@ -128,6 +128,7 @@ public abstract class MainConfig implements Config { } @Order(1000) + @Comment("These options are for fine-tuning, only touch them if you know what you're doing") public MemberCachingConfig memberCaching = new MemberCachingConfig(); @Order(5000) diff --git a/common/src/main/java/com/discordsrv/common/config/main/MessagesMainConfig.java b/common/src/main/java/com/discordsrv/common/config/main/MessagesMainConfig.java index 3062b5f0..c66cebba 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/MessagesMainConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/MessagesMainConfig.java @@ -25,7 +25,7 @@ import org.spongepowered.configurate.objectmapping.meta.Comment; public class MessagesMainConfig { @Comment("The language code for the default language, if left blank the system default will be used.\n" - + "This should be in the ISO 639-1 format or ISO 639-1 (for example \"en\"), a underscore and a ISO 3166-1 country code to specify dialect (for example \"pt_BR\")") + + "This should be in the ISO 639-1 format (for example \"en\"), or ISO 639-1, a underscore and a ISO 3166-1 country code to specify dialect (for example \"pt_BR\")") public String defaultLanguage = "en"; @Comment("If there should be a messages file per language (based on the player's or user's language), otherwise using the default") 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 b1b88642..69ceb1b8 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 @@ -53,7 +53,7 @@ public class TimedUpdaterConfig { private static final int MINIMUM_MINUTES = 10; @Comment("The channel IDs.\n" - + "The bot will need the \"View Channel\", \"Manage Channels\" and \"Connection\" permissions for the provided channels") + + "The bot will need the \"View Channel\", \"Manage Channels\" and \"Connect\" permissions for the provided channels") public List channelIds = new ArrayList<>(); @Comment("The format for the channel name(s), placeholders are supported.") diff --git a/common/src/main/java/com/discordsrv/common/config/main/channels/JoinMessageConfig.java b/common/src/main/java/com/discordsrv/common/config/main/channels/JoinMessageConfig.java index b0919f2c..d566de5f 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/channels/JoinMessageConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/channels/JoinMessageConfig.java @@ -28,6 +28,7 @@ import com.discordsrv.common.config.main.generic.IMessageConfig; import org.jetbrains.annotations.Nullable; import org.spongepowered.configurate.objectmapping.ConfigSerializable; import org.spongepowered.configurate.objectmapping.meta.Comment; +import org.spongepowered.configurate.objectmapping.meta.Setting; @ConfigSerializable public class JoinMessageConfig implements IMessageConfig { @@ -52,6 +53,7 @@ public class JoinMessageConfig implements IMessageConfig { public Boolean enableSilentPermission = true; @Comment("Ignore if the player leaves within the given amount of milliseconds. This will delay sending the join message") + @Setting("ignore-if-left-within-ms") public Long ignoreIfLeftWithinMS = 250L; @Override diff --git a/common/src/main/java/com/discordsrv/common/config/main/channels/LeaveMessageConfig.java b/common/src/main/java/com/discordsrv/common/config/main/channels/LeaveMessageConfig.java index aa14d8ec..4202053f 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/channels/LeaveMessageConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/channels/LeaveMessageConfig.java @@ -26,6 +26,7 @@ import com.discordsrv.common.config.configurate.manager.abstraction.ConfigurateC import com.discordsrv.common.config.main.generic.IMessageConfig; import org.spongepowered.configurate.objectmapping.ConfigSerializable; import org.spongepowered.configurate.objectmapping.meta.Comment; +import org.spongepowered.configurate.objectmapping.meta.Setting; @ConfigSerializable public class LeaveMessageConfig implements IMessageConfig { @@ -50,6 +51,7 @@ public class LeaveMessageConfig implements IMessageConfig { public Boolean enableSilentPermission = true; @Comment("Ignore if the player joined within the given amount of milliseconds") + @Setting("ignore-if-joined-within-ms") public Long ignoreIfJoinedWithinMS = 250L; @Override diff --git a/common/src/main/java/com/discordsrv/common/config/main/channels/MirroringConfig.java b/common/src/main/java/com/discordsrv/common/config/main/channels/MirroringConfig.java index 04f9a422..dedbd90a 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/channels/MirroringConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/channels/MirroringConfig.java @@ -33,7 +33,7 @@ public class MirroringConfig { @Comment("Requires the \"Message Content Intent\"") public Boolean enabled = true; - @Comment("Users, bots, roles and webhooks to ignore when mirroring") + @Comment("Users to not mirror") public DiscordIgnoresConfig ignores = new DiscordIgnoresConfig(); @Comment("The format of the username of mirrored messages\n" diff --git a/common/src/main/java/com/discordsrv/common/config/main/generic/GameCommandExecutionConditionConfig.java b/common/src/main/java/com/discordsrv/common/config/main/generic/GameCommandExecutionConditionConfig.java index edc1c1da..799ce340 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/generic/GameCommandExecutionConditionConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/generic/GameCommandExecutionConditionConfig.java @@ -49,7 +49,7 @@ public class GameCommandExecutionConditionConfig { @Comment("The commands and/or patterns that are allowed/blocked.\n" + "The command needs to start with input, this will attempt to normalize command aliases where possible (for the main command)\n" + - "If the command start and ends with /, the input will be treated as a regular expression (regex) and it will pass if it matches the entire command") + "If the command starts and ends with /, the input will be treated as a regular expression (regex) and it will pass if it matches the entire command") public List commands = new ArrayList<>(); public static boolean isCommandMatch(String configCommand, String command, boolean suggestions, GameCommandExecutionHelper helper) { diff --git a/common/src/main/java/com/discordsrv/common/config/main/linking/LinkedAccountConfig.java b/common/src/main/java/com/discordsrv/common/config/main/linking/LinkedAccountConfig.java index 84c1814e..f315fd5c 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/linking/LinkedAccountConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/linking/LinkedAccountConfig.java @@ -31,10 +31,10 @@ public class LinkedAccountConfig { @Comment("The linked account provider\n" + "\n" - + " - auto: Uses \"minecraftauth\" if the %1 permits it and the server is in online mode or using ip forwarding, otherwise \"%4\"\n" + + " - auto: Uses \"minecraftauth\" if the %1 permits it and the server is in online mode or using ip forwarding, otherwise \"%3\"\n" + " - minecraftauth: Uses %2 as the linked account provider (offline and (non-linked) bedrock players cannot link using this method)\n" + " - storage: Use the configured database for linked accounts") - @Constants.Comment({ConnectionConfig.FILE_NAME, "minecraftauth.me"}) + @Constants.Comment({ConnectionConfig.FILE_NAME, "minecraftauth.me", "storage"}) public Provider provider = Provider.AUTO; public enum Provider { diff --git a/common/src/main/java/com/discordsrv/common/discord/api/entity/message/ReceivedDiscordMessageImpl.java b/common/src/main/java/com/discordsrv/common/discord/api/entity/message/ReceivedDiscordMessageImpl.java index e45e5a9e..5f1c8b21 100644 --- a/common/src/main/java/com/discordsrv/common/discord/api/entity/message/ReceivedDiscordMessageImpl.java +++ b/common/src/main/java/com/discordsrv/common/discord/api/entity/message/ReceivedDiscordMessageImpl.java @@ -291,6 +291,7 @@ public class ReceivedDiscordMessageImpl implements ReceivedDiscordMessage { .addPlaceholder("message", component) .addContext(replyingTo.getMember(), replyingTo.getAuthor(), replyingTo) .build() + // TODO: add contentRegexFilters to this ); }