Added RPC channel and guild entities, Get and Select methods

This commit is contained in:
RogueException
2016-10-08 02:37:04 -03:00
parent f584bd6e28
commit 16c67e79e9
39 changed files with 852 additions and 105 deletions

View File

@@ -0,0 +1,32 @@
using System.Diagnostics;
using Model = Discord.API.Rpc.ChannelSummary;
namespace Discord.Rpc
{
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public class RpcChannelSummary
{
public ulong Id { get; }
public string Name { get; set; }
public ChannelType Type { get; set; }
internal RpcChannelSummary(ulong id)
{
Id = id;
}
internal static RpcChannelSummary Create(Model model)
{
var entity = new RpcChannelSummary(model.Id);
entity.Update(model);
return entity;
}
internal void Update(Model model)
{
Name = model.Name;
Type = model.Type;
}
public override string ToString() => Name;
private string DebuggerDisplay => $"{Name} ({Id}, {Type})";
}
}