* Fix #995 ICategoryChannel.CategoryID throws NotSupportedException * Add tests * change run mode of TestChannelCategories * Add throw for GetCategoryAsync * Add xml doc explaining why exception is thrown * Add test coverage for text and voice channel categories * initial implementation of INestedChannel * more implementation of INestedChannel design * Add case in RestChannel Create for Category type * set the CategoryID for RestVoiceChannel * rewrite channel category tests to work with existing pattern * remove outdated todo * Make IVoiceChannel implement INestedChannel * remove redundant interface implementation * Add c#7 feature from feedback * Remove redundant GetCategoryAsync methods from socket entities * Added configureawait to async methods * change signature of interface GetCategoryAsync * Add check for cachemode in rest channel GetCategory * remove redundant IGuildChannel interface from ITextChannel and IVoiceChannel
This commit is contained in:
committed by
Christopher F
parent
4d8764e124
commit
f9cbff5e42
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
@@ -16,7 +16,6 @@ namespace Discord.Rest
|
||||
internal IGuild Guild { get; }
|
||||
public string Name { get; private set; }
|
||||
public int Position { get; private set; }
|
||||
public ulong? CategoryId { get; private set; }
|
||||
public ulong GuildId => Guild.Id;
|
||||
|
||||
internal RestGuildChannel(BaseDiscordClient discord, IGuild guild, ulong id)
|
||||
@@ -35,7 +34,6 @@ namespace Discord.Rest
|
||||
case ChannelType.Category:
|
||||
return RestCategoryChannel.Create(discord, guild, model);
|
||||
default:
|
||||
// TODO: Channel categories
|
||||
return new RestGuildChannel(discord, guild, model.Id);
|
||||
}
|
||||
}
|
||||
@@ -64,13 +62,6 @@ namespace Discord.Rest
|
||||
public Task DeleteAsync(RequestOptions options = null)
|
||||
=> ChannelHelper.DeleteAsync(this, Discord, options);
|
||||
|
||||
public async Task<ICategoryChannel> GetCategoryAsync()
|
||||
{
|
||||
if (CategoryId.HasValue)
|
||||
return (await Guild.GetChannelAsync(CategoryId.Value).ConfigureAwait(false)) as ICategoryChannel;
|
||||
return null;
|
||||
}
|
||||
|
||||
public OverwritePermissions? GetPermissionOverwrite(IUser user)
|
||||
{
|
||||
for (int i = 0; i < _overwrites.Length; i++)
|
||||
|
||||
Reference in New Issue
Block a user