From 3633929e5f7fb7cd43fc1994fe67196b4ef88aac Mon Sep 17 00:00:00 2001 From: Quin Lynch <49576606+quinchs@users.noreply.github.com> Date: Fri, 14 Jan 2022 07:52:08 -0400 Subject: [PATCH] Move gateway intents warning to ready event (#2042) --- src/Discord.Net.WebSocket/DiscordSocketClient.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index 69c16f88a..10bf88d74 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -261,9 +261,6 @@ namespace Discord.WebSocket _defaultStickers = builder.ToImmutable(); } - - if(LogGatewayIntentWarnings) - await LogGatewayIntentsWarning().ConfigureAwait(false); } /// @@ -314,6 +311,10 @@ namespace Discord.WebSocket //Wait for READY await _connection.WaitAsync().ConfigureAwait(false); + + // Log warnings on ready event + if (LogGatewayIntentWarnings) + await LogGatewayIntentsWarning().ConfigureAwait(false); } private async Task OnDisconnectingAsync(Exception ex) { @@ -743,7 +744,7 @@ namespace Discord.WebSocket if(!_gatewayIntents.HasFlag(GatewayIntents.GuildPresences) && _presenceUpdated.HasSubscribers) { - await _gatewayLogger.WarningAsync("You're using the PresenceUpdate event without specifying the GuildPresences intent, consider adding the intent to your config.").ConfigureAwait(false); + await _gatewayLogger.WarningAsync("You're using the PresenceUpdate event without specifying the GuildPresences intent. Discord wont send this event to your client without the intent set in your config.").ConfigureAwait(false); } bool hasGuildScheduledEventsSubscribers = @@ -762,7 +763,7 @@ namespace Discord.WebSocket if(!_gatewayIntents.HasFlag(GatewayIntents.GuildScheduledEvents) && hasGuildScheduledEventsSubscribers) { - await _gatewayLogger.WarningAsync("You're using events related to the GuildScheduledEvents gateway intent without specifying the intent, consider adding the intent to your config.").ConfigureAwait(false); + await _gatewayLogger.WarningAsync("You're using events related to the GuildScheduledEvents gateway intent without specifying the intent. Discord wont send this event to your client without the intent set in your config.").ConfigureAwait(false); } bool hasInviteEventSubscribers = @@ -776,7 +777,7 @@ namespace Discord.WebSocket if (!_gatewayIntents.HasFlag(GatewayIntents.GuildInvites) && hasInviteEventSubscribers) { - await _gatewayLogger.WarningAsync("You're using events related to the GuildInvites gateway intent without specifying the intent, consider adding the intent to your config.").ConfigureAwait(false); + await _gatewayLogger.WarningAsync("You're using events related to the GuildInvites gateway intent without specifying the intent. Discord wont send this event to your client without the intent set in your config.").ConfigureAwait(false); } }