From 3f6d581c8395d6b8956f96e0b68b59a6f95f5eaa Mon Sep 17 00:00:00 2001 From: TheUbMunster Date: Sat, 24 Dec 2022 20:15:34 -0700 Subject: [PATCH] Filter out a non-issue warning. --- Server/DiscordBot.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Server/DiscordBot.cs b/Server/DiscordBot.cs index b84c27f..327ef14 100644 --- a/Server/DiscordBot.cs +++ b/Server/DiscordBot.cs @@ -72,10 +72,14 @@ 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.StartsWith("")) - //{ - // return; - //} + 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; + } string message = a.Message + (a.Exception != null ? "Exception: " + a.Exception.ToString() : ""); ConsoleColor col; switch (a.Severity)