Browse Source

Added MessageType

tags/1.0-rc
RogueException 9 years ago
parent
commit
d94bd7373c
4 changed files with 11 additions and 5 deletions
  1. +2
    -0
      src/Discord.Net/API/Common/Message.cs
  2. +2
    -0
      src/Discord.Net/Entities/Messages/IMessage.cs
  3. +6
    -4
      src/Discord.Net/Entities/Messages/Message.cs
  4. +1
    -1
      src/Discord.Net/Entities/Messages/MessageType.cs

+ 2
- 0
src/Discord.Net/API/Common/Message.cs View File

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


+ 2
- 0
src/Discord.Net/Entities/Messages/IMessage.cs View File

@@ -18,6 +18,8 @@ namespace Discord
/// <summary> Gets the time this message was sent. </summary>
DateTimeOffset Timestamp { get; }

/// <summary> Gets the type of this message. </summary>
MessageType Type { get; }
/// <summary> Gets the channel this message was sent to. </summary>
IMessageChannel Channel { get; }
/// <summary> Gets the author of this message. </summary>


+ 6
- 4
src/Discord.Net/Entities/Messages/Message.cs View File

@@ -14,14 +14,15 @@ namespace Discord
private bool _isMentioningEveryone;
private long _timestampTicks;
private long? _editedTimestampTicks;
public MessageType Type { get; }
public IMessageChannel Channel { get; }
public IUser Author { get; }

public bool IsTTS { get; private set; }
public string Text { 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<IEmbed> Embeds { get; private set; }
public IReadOnlyCollection<ulong> MentionedChannelIds { get; private set; }
@@ -37,6 +38,7 @@ namespace Discord
{
Channel = channel;
Author = author;
Type = model.Type;

if (channel is IGuildChannel)
{


src/Discord.Net/API/Common/MessageType.cs → src/Discord.Net/Entities/Messages/MessageType.cs View File

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

Loading…
Cancel
Save