From 2ba04dfc84da0d9c62b52d04ec89583343606886 Mon Sep 17 00:00:00 2001 From: TheKingEagle <30922258+rmsoftware-development@users.noreply.github.com> Date: Sat, 4 Apr 2020 23:12:59 -0400 Subject: [PATCH] Fix for Issue #1471 This change will allow `GuildAvailable` to fire when the client joins a new guild, as well as properly update `IsConnected`. --- src/Discord.Net.WebSocket/DiscordSocketClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index ed142d001..52b917041 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -627,6 +627,10 @@ namespace Discord.WebSocket var guild = AddGuild(data, State); if (guild != null) { + if (_unavailableGuildCount != 0) + _unavailableGuildCount--; + + await GuildAvailableAsync(guild).ConfigureAwait(false); await TimedInvokeAsync(_joinedGuildEvent, nameof(JoinedGuild), guild).ConfigureAwait(false); } else