From 7fcd7720c0df0633ae982b14302c566d7bf361a7 Mon Sep 17 00:00:00 2001 From: Alex Gravely Date: Sat, 9 Sep 2017 02:44:20 -0400 Subject: [PATCH] Implement fix on RestChannel. --- src/Discord.Net.Rest/Entities/Channels/RestChannel.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net.Rest/Entities/Channels/RestChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestChannel.cs index 7291b591e..e53d27f5e 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestChannel.cs @@ -6,7 +6,7 @@ using Model = Discord.API.Channel; namespace Discord.Rest { - public abstract class RestChannel : RestEntity, IChannel, IUpdateable + public class RestChannel : RestEntity, IChannel, IUpdateable { public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); @@ -25,7 +25,7 @@ namespace Discord.Rest case ChannelType.Group: return CreatePrivate(discord, model) as RestChannel; default: - throw new InvalidOperationException($"Unexpected channel type: {model.Type}"); + return new RestChannel(discord, model.Id); } } internal static IRestPrivateChannel CreatePrivate(BaseDiscordClient discord, Model model) @@ -40,9 +40,9 @@ namespace Discord.Rest throw new InvalidOperationException($"Unexpected channel type: {model.Type}"); } } - internal abstract void Update(Model model); + internal virtual void Update(Model model) { } - public abstract Task UpdateAsync(RequestOptions options = null); + public virtual Task UpdateAsync(RequestOptions options = null) => Task.Delay(0); //IChannel string IChannel.Name => null;