Browse Source

Implement fix on RestChannel.

pull/811/head
Alex Gravely 8 years ago
parent
commit
7fcd7720c0
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/Discord.Net.Rest/Entities/Channels/RestChannel.cs

+ 4
- 4
src/Discord.Net.Rest/Entities/Channels/RestChannel.cs View File

@@ -6,7 +6,7 @@ using Model = Discord.API.Channel;

namespace Discord.Rest
{
public abstract class RestChannel : RestEntity<ulong>, IChannel, IUpdateable
public class RestChannel : RestEntity<ulong>, 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;


Loading…
Cancel
Save