forked from discord-net/Discord.Net
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix discord-net#995, Move Category Implementation from IGuildChannel …
…to INestedChannel (discord-net#1004) * Fix discord-net#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
- Loading branch information
1 parent
4d8764e
commit f9cbff5
Showing
16 changed files
with
168 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace Discord | ||
{ | ||
/// <summary> | ||
/// A type of guild channel that can be nested within a category. | ||
/// Contains a CategoryId that is set to the parent category, if it is set. | ||
/// </summary> | ||
public interface INestedChannel : IGuildChannel | ||
{ | ||
/// <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(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.