Fix usage of CacheMode.AllowDownload in channels (#2154)

Co-Authored-By:  <25006819+sabihoshi@users.noreply.github.com>

Co-authored-by:  <25006819+sabihoshi@users.noreply.github.com>
This commit is contained in:
Quin Lynch
2022-03-02 19:22:59 -04:00
committed by GitHub
parent 6bf5818e72
commit b3370c33e2
11 changed files with 97 additions and 35 deletions

View File

@@ -261,7 +261,7 @@ namespace Discord.Rest
/// The duration on which this thread archives after.
/// <para>
/// <b>Note: </b> Options <see cref="ThreadArchiveDuration.OneWeek"/> and <see cref="ThreadArchiveDuration.ThreeDays"/>
/// are only available for guilds that are boosted. You can check in the <see cref="IGuild.Features"/> to see if the
/// are only available for guilds that are boosted. You can check in the <see cref="IGuild.Features"/> to see if the
/// guild has the <b>THREE_DAY_THREAD_ARCHIVE</b> and <b>SEVEN_DAY_THREAD_ARCHIVE</b>.
/// </para>
/// </param>
@@ -364,10 +364,9 @@ namespace Discord.Rest
/// <inheritdoc />
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
{
if (mode == CacheMode.AllowDownload)
return GetUsersAsync(options);
else
return AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>();
return mode == CacheMode.AllowDownload
? GetUsersAsync(options)
: AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>();
}
#endregion