Skip to content

Commit 09eb9fa

Browse files
authored
Fix thread member download on create (#2072)
1 parent 82f3879 commit 09eb9fa

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Discord.Net.WebSocket/DiscordSocketClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,6 +2913,9 @@ internal void EnsureGatewayIntent(GatewayIntents intents)
29132913
}
29142914
}
29152915

2916+
internal bool HasGatewayIntent(GatewayIntents intents)
2917+
=> _gatewayIntents.HasFlag(intents);
2918+
29162919
private async Task GuildAvailableAsync(SocketGuild guild)
29172920
{
29182921
if (!guild.IsConnected)

src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ public virtual async Task<SocketThreadChannel> CreateThreadAsync(string name, Th
119119

120120
var thread = (SocketThreadChannel)Guild.AddOrUpdateChannel(Discord.State, model);
121121

122-
await thread.DownloadUsersAsync();
122+
if(Discord.AlwaysDownloadUsers && Discord.HasGatewayIntent(GatewayIntents.GuildMembers))
123+
await thread.DownloadUsersAsync();
123124

124125
return thread;
125126
}

0 commit comments

Comments
 (0)