Skip to content

Commit

Permalink
Fix thread member download on create (#2072)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinchs authored Jan 30, 2022
1 parent 82f3879 commit 09eb9fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Discord.Net.WebSocket/DiscordSocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2913,6 +2913,9 @@ internal void EnsureGatewayIntent(GatewayIntents intents)
}
}

internal bool HasGatewayIntent(GatewayIntents intents)
=> _gatewayIntents.HasFlag(intents);

private async Task GuildAvailableAsync(SocketGuild guild)
{
if (!guild.IsConnected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public virtual async Task<SocketThreadChannel> CreateThreadAsync(string name, Th

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

await thread.DownloadUsersAsync();
if(Discord.AlwaysDownloadUsers && Discord.HasGatewayIntent(GatewayIntents.GuildMembers))
await thread.DownloadUsersAsync();

return thread;
}
Expand Down

0 comments on commit 09eb9fa

Please sign in to comment.