From 95272cfa8042e963f62d42cde8a86d0537f64cf6 Mon Sep 17 00:00:00 2001 From: Dinty1 <67452089+Dinty1@users.noreply.github.com> Date: Sat, 17 Jun 2023 13:07:05 +0100 Subject: [PATCH] Misc changes (#1) * Explain how to get token, create documentation config * Reword some stuff * Put this on a new line * Rearrange --- .../discordsrv/common/config/connection/UpdateConfig.java | 4 ++-- .../common/config/documentation/DocumentationURLs.java | 5 +++++ .../discordsrv/common/config/main/DiscordInviteConfig.java | 2 +- .../java/com/discordsrv/common/config/main/MainConfig.java | 2 +- .../common/config/main/channels/ChannelLockingConfig.java | 2 +- .../config/main/channels/DiscordToMinecraftChatConfig.java | 4 ++-- .../common/config/main/channels/MirroringConfig.java | 2 +- .../common/discord/connection/jda/JDAConnectionManager.java | 6 +++++- 8 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 common/src/main/java/com/discordsrv/common/config/documentation/DocumentationURLs.java 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 86768b79..b5ef8ac0 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 @@ -35,7 +35,7 @@ public class UpdateConfig { public boolean notificationInGame = true; @Setting(value = "enable-first-party-api-for-notifications") - @Comment("Weather the DiscordSRV download API should be used for update checks\n" + @Comment("Whether the DiscordSRV download API should be used for update checks\n" + "Requires a connection to: download.discordsrv.com") public boolean firstPartyNotification = true; @@ -49,7 +49,7 @@ public class UpdateConfig { public static class GitHub { @Setting(value = "enabled") - @Comment("Weather the GitHub API should be used for update checks\n" + @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: api.github.com") public boolean enabled = true; diff --git a/common/src/main/java/com/discordsrv/common/config/documentation/DocumentationURLs.java b/common/src/main/java/com/discordsrv/common/config/documentation/DocumentationURLs.java new file mode 100644 index 00000000..b516a924 --- /dev/null +++ b/common/src/main/java/com/discordsrv/common/config/documentation/DocumentationURLs.java @@ -0,0 +1,5 @@ +package com.discordsrv.common.config.documentation; + +public class DocumentationURLs { + public static final String CREATE_TOKEN = "https://docs.discordsrv.com/installation/initial-setup/#setting-up-the-bot"; +} diff --git a/common/src/main/java/com/discordsrv/common/config/main/DiscordInviteConfig.java b/common/src/main/java/com/discordsrv/common/config/main/DiscordInviteConfig.java index 786a2885..25ae8b45 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/DiscordInviteConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/DiscordInviteConfig.java @@ -27,7 +27,7 @@ public class DiscordInviteConfig { @Comment("Manually enter a invite url here, if this isn't set this is ignored and the options below will take effect") public String inviteUrl = ""; - @Comment("If the bot is only in one Discord server, it will attempt to get it's vanity url") + @Comment("If the bot is only in one Discord server, it will attempt to get its vanity url") public boolean attemptToUseVanityUrl = true; @Comment("If the bot is only in one Discord server, it will attempt to automatically create a invite for it.\n" 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 367daecd..a6fa8d2a 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 @@ -59,7 +59,7 @@ public abstract class MainConfig implements Config { + "The key of this option is the in-game channel name (the default keys are \"global\" and \"default\")\n" + "channel-ids and threads can be configured for all channels except \"default\"\n" + "\"default\" is a special section which has the default values for all channels unless they are specified (overridden) under the channel's own section\n" - + "So if you don't specify a certain option under a channel's own section, the option will take it's value from the \"default\" section") + + "So if you don't specify a certain option under a channel's own section, the option will take its value from the \"default\" section") public Map channels = new LinkedHashMap() {{ put(GameChannel.DEFAULT_NAME, createDefaultChannel()); put(ChannelConfig.DEFAULT_KEY, createDefaultBaseChannel()); diff --git a/common/src/main/java/com/discordsrv/common/config/main/channels/ChannelLockingConfig.java b/common/src/main/java/com/discordsrv/common/config/main/channels/ChannelLockingConfig.java index 0fc2057f..f3fe477f 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/channels/ChannelLockingConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/channels/ChannelLockingConfig.java @@ -54,7 +54,7 @@ public class ChannelLockingConfig { @Comment("If the configured threads should be archived while the server is shutdown") public boolean archive = true; - @Comment("If the bot will attempt to unarchive threads rather than make new threads") + @Comment("If the bot should attempt to unarchive threads rather than make new threads") public boolean unarchive = true; } diff --git a/common/src/main/java/com/discordsrv/common/config/main/channels/DiscordToMinecraftChatConfig.java b/common/src/main/java/com/discordsrv/common/config/main/channels/DiscordToMinecraftChatConfig.java index 8dc7a203..675f3dfb 100644 --- a/common/src/main/java/com/discordsrv/common/config/main/channels/DiscordToMinecraftChatConfig.java +++ b/common/src/main/java/com/discordsrv/common/config/main/channels/DiscordToMinecraftChatConfig.java @@ -49,7 +49,7 @@ public class DiscordToMinecraftChatConfig { @Untranslated(Untranslated.Type.VALUE) public Map contentRegexFilters = new LinkedHashMap<>(); - @Comment("Users, bots and webhooks to ignore") + @Comment("Users, bots, roles and webhooks to ignore") public DiscordIgnoresConfig ignores = new DiscordIgnoresConfig(); @Comment("The representations of Discord mentions in-game") @@ -59,7 +59,7 @@ public class DiscordToMinecraftChatConfig { public static class Mentions { public Format role = new Format("ᛩf2@%role_name%", "ᛩf2@deleted-role"); - public Format channel = new Format("[hover:show_text:Click to go to channel][click:open_url:%channel_jump_url%]ᛩf2#%channel_name%", "ᛩf2#deleted-channel"); + public Format channel = new Format("[hover:show_text:Click to go to channel][click:open_url:%channel_jump_url%]ᛩf2#%channel_name%", "ᛩf2#Unknown"); public Format user = new Format("[hover:show_text:Tag: %user_tag%&r\nRoles: %user_roles:', '|text:'&7&oNone'%]ᛩf2@%user_effective_name|user_name%", "ᛩf2@Unknown user"); public String messageUrl = "[hover:show_text:Click to go to message][click:open_url:%jump_url%]ᛩf2#%channel_name% > ..."; 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 fa3661c5..52560ae8 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 @@ -27,7 +27,7 @@ public class MirroringConfig { public boolean enabled = true; - @Comment("Users, bots and webhooks to ignore when mirroring") + @Comment("Users, bots, roles and webhooks to ignore when mirroring") 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/discord/connection/jda/JDAConnectionManager.java b/common/src/main/java/com/discordsrv/common/discord/connection/jda/JDAConnectionManager.java index 38f3c644..40a7b60a 100644 --- a/common/src/main/java/com/discordsrv/common/discord/connection/jda/JDAConnectionManager.java +++ b/common/src/main/java/com/discordsrv/common/discord/connection/jda/JDAConnectionManager.java @@ -33,6 +33,7 @@ import com.discordsrv.api.placeholder.PlaceholderLookupResult; import com.discordsrv.common.DiscordSRV; import com.discordsrv.common.config.connection.BotConfig; import com.discordsrv.common.config.connection.ConnectionConfig; +import com.discordsrv.common.config.documentation.DocumentationURLs; import com.discordsrv.common.config.main.MemberCachingConfig; import com.discordsrv.common.debug.DebugGenerateEvent; import com.discordsrv.common.debug.file.TextDebugFile; @@ -562,7 +563,10 @@ public class JDAConnectionManager implements DiscordConnectionManager { discordSRV.logger().error("| The token provided in the"); discordSRV.logger().error("| " + ConnectionConfig.FILE_NAME + " is invalid"); discordSRV.logger().error("|"); - discordSRV.logger().error("| You can get the token for your bot from:"); + discordSRV.logger().error("| Haven't created a bot yet? Installing the plugin for the first time?"); + discordSRV.logger().error("| See " + DocumentationURLs.CREATE_TOKEN); + discordSRV.logger().error("|"); + discordSRV.logger().error("| Already have a bot? You can get the token for your bot from:"); discordSRV.logger().error("| https://discord.com/developers/applications"); discordSRV.logger().error("| by selecting the application, going to the \"Bot\" tab"); discordSRV.logger().error("| and clicking on \"Reset Token\"");