| @@ -11,6 +11,6 @@ namespace Discord | |||||
| /// <summary> Gets the parentid (category) of this channel in the guild's channel list. </summary> | /// <summary> Gets the parentid (category) of this channel in the guild's channel list. </summary> | ||||
| ulong? CategoryId { get; } | ulong? CategoryId { get; } | ||||
| /// <summary> Gets the parent channel (category) of this channel, if it is set. If unset, returns null.</summary> | /// <summary> Gets the parent channel (category) of this channel, if it is set. If unset, returns null.</summary> | ||||
| Task<ICategoryChannel> GetCategoryAsync(); | |||||
| Task<ICategoryChannel> GetCategoryAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | |||||
| } | } | ||||
| } | } | ||||
| @@ -175,10 +175,10 @@ namespace Discord.Rest | |||||
| } | } | ||||
| // INestedChannel | // INestedChannel | ||||
| async Task<ICategoryChannel> INestedChannel.GetCategoryAsync() | |||||
| async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options) | |||||
| { | { | ||||
| if (CategoryId.HasValue) | if (CategoryId.HasValue) | ||||
| return (await Guild.GetChannelAsync(CategoryId.Value).ConfigureAwait(false)) as ICategoryChannel; | |||||
| return (await Guild.GetChannelAsync(CategoryId.Value, mode, options).ConfigureAwait(false)) as ICategoryChannel; | |||||
| return null; | return null; | ||||
| } | } | ||||
| } | } | ||||
| @@ -54,10 +54,10 @@ namespace Discord.Rest | |||||
| => AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>(); | => AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>(); | ||||
| // INestedChannel | // INestedChannel | ||||
| async Task<ICategoryChannel> INestedChannel.GetCategoryAsync() | |||||
| async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options) | |||||
| { | { | ||||
| if (CategoryId.HasValue) | if (CategoryId.HasValue) | ||||
| return (await Guild.GetChannelAsync(CategoryId.Value).ConfigureAwait(false)) as ICategoryChannel; | |||||
| return (await Guild.GetChannelAsync(CategoryId.Value, mode, options).ConfigureAwait(false)) as ICategoryChannel; | |||||
| return null; | return null; | ||||
| } | } | ||||
| } | } | ||||
| @@ -169,7 +169,7 @@ namespace Discord.WebSocket | |||||
| => EnterTypingState(options); | => EnterTypingState(options); | ||||
| // INestedChannel | // INestedChannel | ||||
| Task<ICategoryChannel> INestedChannel.GetCategoryAsync() | |||||
| Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options) | |||||
| => Task.FromResult(Category); | => Task.FromResult(Category); | ||||
| } | } | ||||
| } | } | ||||
| @@ -66,7 +66,7 @@ namespace Discord.WebSocket | |||||
| => ImmutableArray.Create<IReadOnlyCollection<IGuildUser>>(Users).ToAsyncEnumerable(); | => ImmutableArray.Create<IReadOnlyCollection<IGuildUser>>(Users).ToAsyncEnumerable(); | ||||
| // INestedChannel | // INestedChannel | ||||
| Task<ICategoryChannel> INestedChannel.GetCategoryAsync() | |||||
| Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options) | |||||
| => Task.FromResult(Category); | => Task.FromResult(Category); | ||||
| } | } | ||||
| } | } | ||||