From b372f1695ea48b46c91587a4c0333950f9131443 Mon Sep 17 00:00:00 2001 From: Brandon Smith Date: Fri, 21 Aug 2015 18:16:13 -0300 Subject: [PATCH] Added Channel documentation --- src/Discord.Net/Channel.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net/Channel.cs b/src/Discord.Net/Channel.cs index 8ab723969..9019b4afb 100644 --- a/src/Discord.Net/Channel.cs +++ b/src/Discord.Net/Channel.cs @@ -8,26 +8,37 @@ namespace Discord { private readonly DiscordClient _client; + /// Returns the unique identifier for this channel. public string Id { get; } private string _name; + /// Returns the name of this channel. public string Name { get { return !IsPrivate ? $"#{_name}" : $"@{Recipient.Name}"; } internal set { _name = value; } } + /// Returns false is this is a public chat and true if this is a private chat with another user (see Recipient). public bool IsPrivate { get; } + /// Returns the type of this channel (see ChannelTypes). public string Type { get; internal set; } - + + /// Returns the id of the server containing this channel. public string ServerId { get; } + /// Returns the server containing this channel. [JsonIgnore] public Server Server => ServerId != null ? _client.GetServer(ServerId) : null; + /// For private chats, returns the Id of the target user, otherwise null. [JsonIgnore] public string RecipientId { get; internal set; } + /// For private chats, returns the target user, otherwise null. public User Recipient => _client.GetUser(RecipientId); + /// Returns a collection of all messages the client has in cache. + /// This collection does not guarantee any ordering. [JsonIgnore] public IEnumerable Messages => _client.Messages.Where(x => x.ChannelId == Id); - //Not Implemented + //TODO: Not Implemented + /// Not implemented, stored for reference. public object[] PermissionOverwrites { get; internal set; } internal Channel(string id, string serverId, DiscordClient client)