|
|
@@ -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; |
|
|
|