From d7bb8d5205f66631ed999d1c76519331fe4fbe15 Mon Sep 17 00:00:00 2001 From: Noi Date: Sun, 17 Jul 2022 11:18:28 -0700 Subject: [PATCH] Cut down on log message spam --- ShardInstance.cs | 5 +---- ShardManager.cs | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ShardInstance.cs b/ShardInstance.cs index 5faf5ba..662525c 100644 --- a/ShardInstance.cs +++ b/ShardInstance.cs @@ -81,10 +81,7 @@ public sealed class ShardInstance : IDisposable { private Task Client_Log(LogMessage arg) { // Suppress certain messages if (arg.Message != null) { - // These warnings appear often as of Discord.Net v3... - if (arg.Message.StartsWith("Unknown Dispatch ") || arg.Message.StartsWith("Unknown Channel")) return Task.CompletedTask; - switch (arg.Message) // Connection status messages replaced by ShardManager's output - { + switch (arg.Message) { case "Connecting": case "Connected": case "Ready": diff --git a/ShardManager.cs b/ShardManager.cs index 7f1cb36..00bf8c4 100644 --- a/ShardManager.cs +++ b/ShardManager.cs @@ -114,7 +114,9 @@ class ShardManager : IDisposable { TotalShards = Config.ShardTotal, LogLevel = LogSeverity.Info, DefaultRetryMode = RetryMode.Retry502 | RetryMode.RetryTimeouts, - GatewayIntents = GatewayIntents.Guilds | GatewayIntents.GuildMembers | GatewayIntents.GuildMessages + GatewayIntents = GatewayIntents.Guilds | GatewayIntents.GuildMembers | GatewayIntents.GuildMessages, + SuppressUnknownDispatchWarnings = true, + LogGatewayIntentWarnings = false }; var services = new ServiceCollection() .AddSingleton(s => new ShardInstance(this, s, _textCommands))