Browse Source

add News channel type

pull/1293/head
Chris Johnston 6 years ago
parent
commit
0312699903
4 changed files with 10 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net.Core/Entities/Channels/ChannelType.cs
  2. +1
    -0
      src/Discord.Net.Rest/Entities/Channels/RestChannel.cs
  3. +3
    -0
      src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs
  4. +3
    -0
      src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs

+ 3
- 1
src/Discord.Net.Core/Entities/Channels/ChannelType.cs View File

@@ -12,6 +12,8 @@ namespace Discord
/// <summary> The channel is a group channel. </summary> /// <summary> The channel is a group channel. </summary>
Group = 3, Group = 3,
/// <summary> The channel is a category channel. </summary> /// <summary> The channel is a category channel. </summary>
Category = 4
Category = 4,
/// <summary> The channel is a news channel. </summary>
News = 5
} }
} }

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

@@ -23,6 +23,7 @@ namespace Discord.Rest
{ {
switch (model.Type) switch (model.Type)
{ {
case ChannelType.News:
case ChannelType.Text: case ChannelType.Text:
case ChannelType.Voice: case ChannelType.Voice:
return RestGuildChannel.Create(discord, new RestGuild(discord, model.GuildId.Value), model); return RestGuildChannel.Create(discord, new RestGuild(discord, model.GuildId.Value), model);


+ 3
- 0
src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs View File

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


+ 3
- 0
src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs View File

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


Loading…
Cancel
Save