diff --git a/BirthdayBot.csproj b/BirthdayBot.csproj index ccb3472..fc4da17 100644 --- a/BirthdayBot.csproj +++ b/BirthdayBot.csproj @@ -5,7 +5,7 @@ net6.0 enable enable - 3.2.4 + 3.2.5 NoiTheCat @@ -22,10 +22,10 @@ - + - + diff --git a/Common.cs b/Common.cs index 55c85b4..9244abb 100644 --- a/Common.cs +++ b/Common.cs @@ -43,6 +43,8 @@ static class Common { // For guilds of size over 30, require 85% or more of the members to be known // (26/30, 42/50, 255/300, etc) int threshold = (int)(guild.MemberCount * 0.85); + Program.Log(nameof(HasMostMembersDownloaded), + $"Passing with {guild.DownloadedMemberCount}/{guild.MemberCount} in cache for guild {guild.Id}."); return guild.DownloadedMemberCount >= threshold; } else { // For smaller guilds, fail if two or more members are missing diff --git a/ShardInstance.cs b/ShardInstance.cs index 38ad74c..79ffda2 100644 --- a/ShardInstance.cs +++ b/ShardInstance.cs @@ -70,13 +70,16 @@ class ShardInstance : IDisposable { private Task Client_Log(LogMessage arg) { // Suppress certain messages if (arg.Message != null) { - // TODO remove below line ideally when D.Net bug is fixed + // 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 { case "Connecting": case "Connected": case "Ready": + case "Disconnecting": + case "Disconnected": + case "Resumed previous session": case "Failed to resume previous session": case "Discord.WebSocket.GatewayReconnectException: Server requested a reconnect": return Task.CompletedTask; diff --git a/ShardManager.cs b/ShardManager.cs index bf2b53c..0af1d9a 100644 --- a/ShardManager.cs +++ b/ShardManager.cs @@ -115,8 +115,7 @@ class ShardManager : IDisposable { ShardId = shardId, TotalShards = Config.ShardTotal, LogLevel = LogSeverity.Info, - DefaultRetryMode = RetryMode.RetryRatelimit, - MessageCacheSize = 0, // not needed at all + DefaultRetryMode = RetryMode.AlwaysRetry, GatewayIntents = GatewayIntents.Guilds | GatewayIntents.GuildMembers | GatewayIntents.GuildMessages }; var newClient = new DiscordSocketClient(clientConf);