diff --git a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs index 1032b34d7..cdba2b67d 100644 --- a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs +++ b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs @@ -834,7 +834,11 @@ namespace Discord.WebSocket /// users found within this guild. /// public IAsyncEnumerable> GetUsersAsync(RequestOptions options = null) - => GuildHelper.GetUsersAsync(this, Discord, null, null, options); + { + if (HasAllMembers) + return ImmutableArray.Create(Users).ToAsyncEnumerable>(); + return GuildHelper.GetUsersAsync(this, Discord, null, null, options); + } /// public async Task DownloadUsersAsync() @@ -1202,7 +1206,7 @@ namespace Discord.WebSocket /// async Task> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options) { - if (mode == CacheMode.AllowDownload) + if (mode == CacheMode.AllowDownload && !HasAllMembers) return (await GetUsersAsync(options).FlattenAsync().ConfigureAwait(false)).ToImmutableArray(); else return Users;