Create unspecified channel object for unknown channel types (#811)

* Partial fix of #810, addresses critical connection issues.

* Implement fix for REST.

* Implement fix on RestChannel.
This commit is contained in:
Alex Gravely
2017-09-09 10:56:03 -04:00
committed by Finite Reality
parent 479361bbea
commit ec03883e26
3 changed files with 14 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ using Model = Discord.API.Channel;
namespace Discord.Rest
{
public abstract class RestGuildChannel : RestChannel, IGuildChannel, IUpdateable
public class RestGuildChannel : RestChannel, IGuildChannel, IUpdateable
{
private ImmutableArray<Overwrite> _overwrites;
@@ -33,7 +33,8 @@ namespace Discord.Rest
case ChannelType.Voice:
return RestVoiceChannel.Create(discord, guild, model);
default:
throw new InvalidOperationException("Unknown guild channel type");
// TODO: Channel categories
return new RestGuildChannel(discord, guild, model.Id);
}
}
internal override void Update(Model model)