From cafa53790e478a7083c591d5ae48b81519f1f590 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Tue, 27 Mar 2018 00:44:13 -0700 Subject: [PATCH] Fix #995 ICategoryChannel.CategoryID throws NotSupportedException --- src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs | 4 +++- .../Entities/Channels/SocketCategoryChannel.cs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs index 397e14e76..2a89edb37 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -25,6 +25,8 @@ namespace Discord.Rest private string DebuggerDisplay => $"{Name} ({Id}, Category)"; // IGuildChannel + ulong? IGuildChannel.CategoryId + => throw new NotSupportedException(); IAsyncEnumerable> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options) => throw new NotSupportedException(); Task IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs index e7a165c2f..9986ebf9c 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs @@ -51,6 +51,8 @@ namespace Discord.WebSocket internal new SocketCategoryChannel Clone() => MemberwiseClone() as SocketCategoryChannel; // IGuildChannel + ulong? IGuildChannel.CategoryId + => throw new NotSupportedException(); IAsyncEnumerable> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options) => ImmutableArray.Create>(Users).ToAsyncEnumerable(); Task IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)