Cut down on log message spam

This commit is contained in:
Noi 2022-07-17 11:18:28 -07:00
parent 18de4e3b70
commit d7bb8d5205
2 changed files with 4 additions and 5 deletions

View file

@ -81,10 +81,7 @@ public sealed class ShardInstance : IDisposable {
private Task Client_Log(LogMessage arg) { private Task Client_Log(LogMessage arg) {
// Suppress certain messages // Suppress certain messages
if (arg.Message != null) { if (arg.Message != null) {
// These warnings appear often as of Discord.Net v3... switch (arg.Message) {
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
{
case "Connecting": case "Connecting":
case "Connected": case "Connected":
case "Ready": case "Ready":

View file

@ -114,7 +114,9 @@ class ShardManager : IDisposable {
TotalShards = Config.ShardTotal, TotalShards = Config.ShardTotal,
LogLevel = LogSeverity.Info, LogLevel = LogSeverity.Info,
DefaultRetryMode = RetryMode.Retry502 | RetryMode.RetryTimeouts, 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() var services = new ServiceCollection()
.AddSingleton(s => new ShardInstance(this, s, _textCommands)) .AddSingleton(s => new ShardInstance(this, s, _textCommands))