| @@ -834,7 +834,11 @@ namespace Discord.WebSocket | |||||
| /// users found within this guild. | /// users found within this guild. | ||||
| /// </returns> | /// </returns> | ||||
| public IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> GetUsersAsync(RequestOptions options = null) | public IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> GetUsersAsync(RequestOptions options = null) | ||||
| => GuildHelper.GetUsersAsync(this, Discord, null, null, options); | |||||
| { | |||||
| if (HasAllMembers) | |||||
| return ImmutableArray.Create(Users).ToAsyncEnumerable<IReadOnlyCollection<IGuildUser>>(); | |||||
| return GuildHelper.GetUsersAsync(this, Discord, null, null, options); | |||||
| } | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| public async Task DownloadUsersAsync() | public async Task DownloadUsersAsync() | ||||
| @@ -1202,7 +1206,7 @@ namespace Discord.WebSocket | |||||
| /// <inheritdoc /> | /// <inheritdoc /> | ||||
| async Task<IReadOnlyCollection<IGuildUser>> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options) | async Task<IReadOnlyCollection<IGuildUser>> IGuild.GetUsersAsync(CacheMode mode, RequestOptions options) | ||||
| { | { | ||||
| if (mode == CacheMode.AllowDownload) | |||||
| if (mode == CacheMode.AllowDownload && !HasAllMembers) | |||||
| return (await GetUsersAsync(options).FlattenAsync().ConfigureAwait(false)).ToImmutableArray(); | return (await GetUsersAsync(options).FlattenAsync().ConfigureAwait(false)).ToImmutableArray(); | ||||
| else | else | ||||
| return Users; | return Users; | ||||