Added MessageType

This commit is contained in:
RogueException
2016-07-15 22:29:35 -03:00
parent a13b10ed5d
commit d94bd7373c
4 changed files with 11 additions and 5 deletions

View File

@@ -7,6 +7,8 @@ namespace Discord.API
{ {
[JsonProperty("id")] [JsonProperty("id")]
public ulong Id { get; set; } public ulong Id { get; set; }
[JsonProperty("type")]
public MessageType Type { get; set; }
[JsonProperty("channel_id")] [JsonProperty("channel_id")]
public ulong ChannelId { get; set; } public ulong ChannelId { get; set; }
[JsonProperty("author")] [JsonProperty("author")]

View File

@@ -18,6 +18,8 @@ namespace Discord
/// <summary> Gets the time this message was sent. </summary> /// <summary> Gets the time this message was sent. </summary>
DateTimeOffset Timestamp { get; } DateTimeOffset Timestamp { get; }
/// <summary> Gets the type of this message. </summary>
MessageType Type { get; }
/// <summary> Gets the channel this message was sent to. </summary> /// <summary> Gets the channel this message was sent to. </summary>
IMessageChannel Channel { get; } IMessageChannel Channel { get; }
/// <summary> Gets the author of this message. </summary> /// <summary> Gets the author of this message. </summary>

View File

@@ -14,14 +14,15 @@ namespace Discord
private bool _isMentioningEveryone; private bool _isMentioningEveryone;
private long _timestampTicks; private long _timestampTicks;
private long? _editedTimestampTicks; private long? _editedTimestampTicks;
public MessageType Type { get; }
public IMessageChannel Channel { get; }
public IUser Author { get; }
public bool IsTTS { get; private set; } public bool IsTTS { get; private set; }
public string Text { get; private set; } public string Text { get; private set; }
public bool IsPinned { get; private set; } public bool IsPinned { get; private set; }
public IMessageChannel Channel { get; }
public IUser Author { get; }
public IReadOnlyCollection<IAttachment> Attachments { get; private set; } public IReadOnlyCollection<IAttachment> Attachments { get; private set; }
public IReadOnlyCollection<IEmbed> Embeds { get; private set; } public IReadOnlyCollection<IEmbed> Embeds { get; private set; }
public IReadOnlyCollection<ulong> MentionedChannelIds { get; private set; } public IReadOnlyCollection<ulong> MentionedChannelIds { get; private set; }
@@ -37,6 +38,7 @@ namespace Discord
{ {
Channel = channel; Channel = channel;
Author = author; Author = author;
Type = model.Type;
if (channel is IGuildChannel) if (channel is IGuildChannel)
{ {

View File

@@ -1,4 +1,4 @@
namespace Discord.API.Common namespace Discord
{ {
public enum MessageType public enum MessageType
{ {