diff --git a/Server/DiscordBot.cs b/Server/DiscordBot.cs index 327ef14..b4da11c 100644 --- a/Server/DiscordBot.cs +++ b/Server/DiscordBot.cs @@ -72,13 +72,16 @@ public class DiscordBot { //as time goes on, we may encounter logged info that we literally don't care about. Fill out an if statement to properly //filter it out to avoid logging it to discord. - if (a.Message.Contains("Server requested a reconnect")) + if (localSettings.FilterOutNonIssueWarnings) { - //This is to filter out this message. This warning is for discord server load balancing and isn't a problem + if (a.Message.Contains("Server requested a reconnect")) + { + //This is to filter out this message. This warning is for discord server load balancing and isn't a problem - //Warning[Discord: Gateway] Discord.WebSocket.GatewayReconnectException: Server requested a reconnect - //Warning[Discord: Gateway] at Discord.ConnectionManager.<> c__DisplayClass29_0.<< StartAsync > b__0 > d.MoveNext() - return; + //Warning[Discord: Gateway] Discord.WebSocket.GatewayReconnectException: Server requested a reconnect + //Warning[Discord: Gateway] at Discord.ConnectionManager.<> c__DisplayClass29_0.<< StartAsync > b__0 > d.MoveNext() + return; + } } string message = a.Message + (a.Exception != null ? "Exception: " + a.Exception.ToString() : ""); ConsoleColor col; diff --git a/Server/Settings.cs b/Server/Settings.cs index 859624f..2228dbc 100644 --- a/Server/Settings.cs +++ b/Server/Settings.cs @@ -77,6 +77,7 @@ public class Settings { [JsonProperty(PropertyName = "LogChannel")] public string? AdminChannel { get; set; } public bool LogCommands { get; set; } = false; + public bool FilterOutNonIssueWarnings { get; set; } = true; } public class ShineTable {