From 4589d73187871c98485ed25c6d223706927af7ec Mon Sep 17 00:00:00 2001 From: mrspits4ever Date: Wed, 13 Dec 2017 21:17:46 +0100 Subject: [PATCH] adressed requested changes --- src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs | 2 +- src/Discord.Net.Core/Entities/Guilds/IGuild.cs | 4 ++-- src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs | 2 +- src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs | 4 ++-- src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs | 2 +- .../Entities/Channels/SocketGuildChannel.cs | 2 +- src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs b/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs index 6d830672b..90d1175d4 100644 --- a/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs +++ b/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs @@ -12,7 +12,7 @@ namespace Discord /// Gets the parentid (category) of this channel in the guild's channel list. ulong? CategoryId { get; } /// Gets the parent channel (category) of this channel. - Task GetCategory(); + Task GetCategoryAsync(); /// Gets the guild this channel is a member of. IGuild Guild { get; } /// Gets the id of the guild this channel is a member of. diff --git a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs index 83953cf12..94eb67b61 100644 --- a/src/Discord.Net.Core/Entities/Guilds/IGuild.cs +++ b/src/Discord.Net.Core/Entities/Guilds/IGuild.cs @@ -84,7 +84,7 @@ namespace Discord Task> GetTextChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); Task GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); Task> GetVoiceChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); - Task> GetCategoryChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); + Task> GetCategoriesAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); Task GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); Task GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); Task GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); @@ -95,7 +95,7 @@ namespace Discord /// Creates a new voice channel. Task CreateVoiceChannelAsync(string name, RequestOptions options = null); /// Creates a new channel category. - Task CreateCategoryChannelAsync(string name, RequestOptions options = null); + Task CreateCategoryAsync(string name, RequestOptions options = null); Task> GetIntegrationsAsync(RequestOptions options = null); Task CreateIntegrationAsync(ulong id, string type, RequestOptions options = null); diff --git a/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs index 3484a333e..2f6b6a174 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs @@ -17,7 +17,7 @@ namespace Discord.Rest public string Name { get; private set; } public int Position { get; private set; } public ulong? CategoryId { get; private set; } - public async Task GetCategory() => CategoryId == null ? null : await Guild.GetChannelAsync(CategoryId.Value) as ICategoryChannel; + public async Task GetCategoryAsync() => CategoryId == null ? null : await Guild.GetChannelAsync(CategoryId.Value).ConfigureAwait(false) as ICategoryChannel; public ulong GuildId => Guild.Id; diff --git a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs index 7dcb631f5..f0e95a9a6 100644 --- a/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs +++ b/src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs @@ -311,7 +311,7 @@ namespace Discord.Rest else return ImmutableArray.Create(); } - async Task> IGuild.GetCategoryChannelsAsync(CacheMode mode , RequestOptions options) + async Task> IGuild.GetCategoriesAsync(CacheMode mode, RequestOptions options) { if (mode == CacheMode.AllowDownload) return await GetCategoryChannelsAsync(options).ConfigureAwait(false); @@ -357,7 +357,7 @@ namespace Discord.Rest => await CreateTextChannelAsync(name, options).ConfigureAwait(false); async Task IGuild.CreateVoiceChannelAsync(string name, RequestOptions options) => await CreateVoiceChannelAsync(name, options).ConfigureAwait(false); - async Task IGuild.CreateCategoryChannelAsync(string name, RequestOptions options) + async Task IGuild.CreateCategoryAsync(string name, RequestOptions options) => await CreateCategoryChannelAsync(name, options).ConfigureAwait(false); async Task> IGuild.GetIntegrationsAsync(RequestOptions options) diff --git a/src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs b/src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs index 47eb5cc80..983f30106 100644 --- a/src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs +++ b/src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs @@ -58,7 +58,7 @@ namespace Discord.Rpc public override string ToString() => Name; //IGuildChannel - public Task GetCategory() + public Task GetCategoryAsync() { //Always fails throw new InvalidOperationException("Unable to return this entity's parent unless it was fetched through that object."); diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs index 8eed157cc..27edf3441 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs @@ -19,7 +19,7 @@ namespace Discord.WebSocket public int Position { get; private set; } public ulong? CategoryId { get; private set; } public ICategoryChannel Category => CategoryId == null ? null : Guild.GetChannel(CategoryId.Value) as ICategoryChannel; - Task IGuildChannel.GetCategory() => Task.FromResult(Category); + Task IGuildChannel.GetCategoryAsync() => Task.FromResult(Category); public IReadOnlyCollection PermissionOverwrites => _overwrites; public new virtual IReadOnlyCollection Users => ImmutableArray.Create(); diff --git a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs index 657bf5335..3df2d5192 100644 --- a/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs +++ b/src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs @@ -639,7 +639,7 @@ namespace Discord.WebSocket => Task.FromResult(GetTextChannel(id)); Task> IGuild.GetVoiceChannelsAsync(CacheMode mode, RequestOptions options) => Task.FromResult>(VoiceChannels); - Task> IGuild.GetCategoryChannelsAsync(CacheMode mode , RequestOptions options) + Task> IGuild.GetCategoriesAsync(CacheMode mode , RequestOptions options) => Task.FromResult>(CategoryChannels); Task IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options) => Task.FromResult(GetVoiceChannel(id)); @@ -655,7 +655,7 @@ namespace Discord.WebSocket => await CreateTextChannelAsync(name, options).ConfigureAwait(false); async Task IGuild.CreateVoiceChannelAsync(string name, RequestOptions options) => await CreateVoiceChannelAsync(name, options).ConfigureAwait(false); - async Task IGuild.CreateCategoryChannelAsync(string name, RequestOptions options) + async Task IGuild.CreateCategoryAsync(string name, RequestOptions options) => await CreateCategoryChannelAsync(name, options).ConfigureAwait(false); async Task> IGuild.GetIntegrationsAsync(RequestOptions options)