From dd0da361944d6f11a42770e6b0f7426e5694fb4e Mon Sep 17 00:00:00 2001 From: d4n3436 Date: Tue, 7 Jun 2022 19:01:48 -0500 Subject: [PATCH] Allow interactions with `GatewayIntents.None` --- src/Discord.Net.WebSocket/DiscordSocketClient.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index 5743d9abd..e4f740436 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -2318,7 +2318,7 @@ namespace Discord.WebSocket case "INTERACTION_CREATE": { await _gatewayLogger.DebugAsync("Received Dispatch (INTERACTION_CREATE)").ConfigureAwait(false); - + var data = (payload as JToken).ToObject(_serializer); var guild = data.GuildId.IsSpecified ? GetGuild(data.GuildId.Value) : null; @@ -2326,7 +2326,6 @@ namespace Discord.WebSocket if (guild != null && !guild.IsSynced) { await UnsyncedGuildAsync(type, guild.Id).ConfigureAwait(false); - return; } SocketUser user = data.User.IsSpecified @@ -2346,15 +2345,8 @@ namespace Discord.WebSocket { channel = CreateDMChannel(data.ChannelId.Value, user, State); } - else - { - if (guild != null) // The guild id is set, but the guild cannot be found as the bot scope is not set. - { - await UnknownChannelAsync(type, data.ChannelId.Value).ConfigureAwait(false); - return; - } - // The channel isnt required when responding to an interaction, so we can leave the channel null. - } + + // The channel isnt required when responding to an interaction, so we can leave the channel null. } } else if (data.User.IsSpecified)