Browse Source

actually create the news channels when given the type

pull/1293/head
Chris Johnston 6 years ago
parent
commit
3cbdbf529f
3 changed files with 3 additions and 5 deletions
  1. +1
    -2
      src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs
  2. +1
    -2
      src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs
  3. +1
    -1
      src/Discord.Net.WebSocket/Entities/Channels/SocketNewsChannel.cs

+ 1
- 2
src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs View File

@@ -35,8 +35,7 @@ namespace Discord.Rest
switch (model.Type)
{
case ChannelType.News:
// TODO: create new RestNewsChannel
throw new NotImplementedException();
return RestNewsChannel.Create(discord, guild, model);
case ChannelType.Text:
return RestTextChannel.Create(discord, guild, model);
case ChannelType.Voice:


+ 1
- 2
src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs View File

@@ -49,8 +49,7 @@ namespace Discord.WebSocket
switch (model.Type)
{
case ChannelType.News:
// TODO: create new SocketNewsChannel
throw new NotImplementedException();
return SocketNewsChannel.Create(guild, state, model);
case ChannelType.Text:
return SocketTextChannel.Create(guild, state, model);
case ChannelType.Voice:


+ 1
- 1
src/Discord.Net.WebSocket/Entities/Channels/SocketNewsChannel.cs View File

@@ -13,7 +13,7 @@ namespace Discord.WebSocket
:base(discord, id, guild)
{
}
internal new static SocketTextChannel Create(SocketGuild guild, ClientState state, Model model)
internal new static SocketNewsChannel Create(SocketGuild guild, ClientState state, Model model)
{
var entity = new SocketNewsChannel(guild.Discord, model.Id, guild);
entity.Update(state, model);


Loading…
Cancel
Save