Browse Source

add [Socket/Rest]NewsChannel types

pull/1293/head
Chris Johnston 6 years ago
parent
commit
e0935825b9
2 changed files with 51 additions and 0 deletions
  1. +28
    -0
      src/Discord.Net.Rest/Entities/Channels/RestNewsChannel.cs
  2. +23
    -0
      src/Discord.Net.WebSocket/Entities/Channels/SocketNewsChannel.cs

+ 28
- 0
src/Discord.Net.Rest/Entities/Channels/RestNewsChannel.cs View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model = Discord.API.Channel;

namespace Discord.Rest
{
/// <summary>
/// Represents a REST-based news channel in a guild that has the same properties as a <see cref="RestTextChannel"/>.
/// </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class RestNewsChannel : RestTextChannel
{
internal RestNewsChannel(BaseDiscordClient discord, IGuild guild, ulong id)
:base(discord, guild, id)
{
}
internal new static RestNewsChannel Create(BaseDiscordClient discord, IGuild guild, Model model)
{
var entity = new RestNewsChannel(discord, guild, model.Id);
entity.Update(model);
return entity;
}
}
}

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

@@ -0,0 +1,23 @@
using System.Diagnostics;
using Model = Discord.API.Channel;

namespace Discord.WebSocket
{
/// <summary>
/// Represents a WebSocket-based news channel in a guild that has the same properties as a <see cref="RestTextChannel"/>.
/// </summary>
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class SocketNewsChannel : SocketTextChannel
{
internal SocketNewsChannel(DiscordSocketClient discord, ulong id, SocketGuild guild)
:base(discord, id, guild)
{
}
internal new static SocketTextChannel Create(SocketGuild guild, ClientState state, Model model)
{
var entity = new SocketNewsChannel(guild.Discord, model.Id, guild);
entity.Update(state, model);
return entity;
}
}
}

Loading…
Cancel
Save