Browse Source

Fix #995 ICategoryChannel.CategoryID throws NotSupportedException

pull/1004/head
Chris Johnston 8 years ago
parent
commit
cafa53790e
2 changed files with 5 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs
  2. +2
    -0
      src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs

+ 3
- 1
src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs View File

@@ -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<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
=> throw new NotSupportedException();
Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)


+ 2
- 0
src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs View File

@@ -51,6 +51,8 @@ namespace Discord.WebSocket
internal new SocketCategoryChannel Clone() => MemberwiseClone() as SocketCategoryChannel;

// IGuildChannel
ulong? IGuildChannel.CategoryId
=> throw new NotSupportedException();
IAsyncEnumerable<IReadOnlyCollection<IGuildUser>> IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
=> ImmutableArray.Create<IReadOnlyCollection<IGuildUser>>(Users).ToAsyncEnumerable();
Task<IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)


Loading…
Cancel
Save