Browse Source

change signature of interface GetCategoryAsync

pull/1004/head
Chris Johnston 8 years ago
parent
commit
cd37d63be4
5 changed files with 7 additions and 7 deletions
  1. +1
    -1
      src/Discord.Net.Core/Entities/Channels/INestedChannel.cs
  2. +2
    -2
      src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs
  3. +2
    -2
      src/Discord.Net.Rest/Entities/Channels/RestVoiceChannel.cs
  4. +1
    -1
      src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs
  5. +1
    -1
      src/Discord.Net.WebSocket/Entities/Channels/SocketVoiceChannel.cs

+ 1
- 1
src/Discord.Net.Core/Entities/Channels/INestedChannel.cs View File

@@ -11,6 +11,6 @@ namespace Discord
/// <summary> Gets the parentid (category) of this channel in the guild's channel list. </summary>
ulong? CategoryId { get; }
/// <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);
}
}

+ 2
- 2
src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs View File

@@ -175,10 +175,10 @@ namespace Discord.Rest
}

// INestedChannel
async Task<ICategoryChannel> INestedChannel.GetCategoryAsync()
async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
{
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;
}
}


+ 2
- 2
src/Discord.Net.Rest/Entities/Channels/RestVoiceChannel.cs View File

@@ -54,10 +54,10 @@ namespace Discord.Rest
=> AsyncEnumerable.Empty<IReadOnlyCollection<IGuildUser>>();

// INestedChannel
async Task<ICategoryChannel> INestedChannel.GetCategoryAsync()
async Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
{
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;
}
}


+ 1
- 1
src/Discord.Net.WebSocket/Entities/Channels/SocketTextChannel.cs View File

@@ -169,7 +169,7 @@ namespace Discord.WebSocket
=> EnterTypingState(options);

// INestedChannel
Task<ICategoryChannel> INestedChannel.GetCategoryAsync()
Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult(Category);
}
}

+ 1
- 1
src/Discord.Net.WebSocket/Entities/Channels/SocketVoiceChannel.cs View File

@@ -66,7 +66,7 @@ namespace Discord.WebSocket
=> ImmutableArray.Create<IReadOnlyCollection<IGuildUser>>(Users).ToAsyncEnumerable();

// INestedChannel
Task<ICategoryChannel> INestedChannel.GetCategoryAsync()
Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult(Category);
}
}

Loading…
Cancel
Save