Added a few missing properties
This commit is contained in:
@@ -162,6 +162,10 @@ namespace Discord.API.Models
|
|||||||
public int Size;
|
public int Size;
|
||||||
[JsonProperty(PropertyName = "filename")]
|
[JsonProperty(PropertyName = "filename")]
|
||||||
public string Filename;
|
public string Filename;
|
||||||
|
[JsonProperty(PropertyName = "width")]
|
||||||
|
public int Width;
|
||||||
|
[JsonProperty(PropertyName = "height")]
|
||||||
|
public int Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonProperty(PropertyName = "tts")]
|
[JsonProperty(PropertyName = "tts")]
|
||||||
@@ -170,6 +174,8 @@ namespace Discord.API.Models
|
|||||||
public bool IsMentioningEveryone;
|
public bool IsMentioningEveryone;
|
||||||
[JsonProperty(PropertyName = "timestamp")]
|
[JsonProperty(PropertyName = "timestamp")]
|
||||||
public DateTime Timestamp;
|
public DateTime Timestamp;
|
||||||
|
[JsonProperty(PropertyName = "edited_timestamp")]
|
||||||
|
public DateTime? EditedTimestamp;
|
||||||
[JsonProperty(PropertyName = "mentions")]
|
[JsonProperty(PropertyName = "mentions")]
|
||||||
public UserReference[] Mentions;
|
public UserReference[] Mentions;
|
||||||
[JsonProperty(PropertyName = "embeds")]
|
[JsonProperty(PropertyName = "embeds")]
|
||||||
|
|||||||
@@ -164,7 +164,9 @@ namespace Discord
|
|||||||
Url = x.Url,
|
Url = x.Url,
|
||||||
ProxyUrl = x.ProxyUrl,
|
ProxyUrl = x.ProxyUrl,
|
||||||
Size = x.Size,
|
Size = x.Size,
|
||||||
Filename = x.Filename
|
Filename = x.Filename,
|
||||||
|
Width = x.Width,
|
||||||
|
Height = x.Height
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -176,6 +178,7 @@ namespace Discord
|
|||||||
message.IsMentioningMe = message.MentionIds.Contains(UserId);
|
message.IsMentioningMe = message.MentionIds.Contains(UserId);
|
||||||
message.RawText = extendedModel.Content;
|
message.RawText = extendedModel.Content;
|
||||||
message.Timestamp = extendedModel.Timestamp;
|
message.Timestamp = extendedModel.Timestamp;
|
||||||
|
message.EditedTimestamp = extendedModel.EditedTimestamp;
|
||||||
if (extendedModel.Author != null)
|
if (extendedModel.Author != null)
|
||||||
message.UserId = extendedModel.Author.Id;
|
message.UserId = extendedModel.Author.Id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,21 +2,27 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
|
|
||||||
namespace Discord
|
namespace Discord
|
||||||
{
|
{
|
||||||
public sealed class Message
|
public sealed class Message
|
||||||
{
|
{
|
||||||
|
public class Attachment
|
||||||
public struct Attachment
|
|
||||||
{
|
{
|
||||||
public string Id;
|
/// <summary> Unique identifier for this file. </summary>
|
||||||
public string Url;
|
public string Id { get; internal set; }
|
||||||
public string ProxyUrl;
|
/// <summary> Download url for this file. </summary>
|
||||||
public int Size;
|
public string Url { get; internal set; }
|
||||||
public string Filename;
|
/// <summary> Preview url for this file. </summary>
|
||||||
|
public string ProxyUrl { get; internal set; }
|
||||||
|
/// <summary> Width of the this file, if it is an image. </summary>
|
||||||
|
public int? Width { get; internal set; }
|
||||||
|
/// <summary> Height of this file, if it is an image. </summary>
|
||||||
|
public int? Height { get; internal set; }
|
||||||
|
/// <summary> Size, in bytes, of this file file. </summary>
|
||||||
|
public int Size { get; internal set; }
|
||||||
|
/// <summary> Filename of this file. </summary>
|
||||||
|
public string Filename { get; internal set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly DiscordClient _client;
|
private readonly DiscordClient _client;
|
||||||
@@ -37,8 +43,10 @@ namespace Discord
|
|||||||
/// <summary> Returns the content of this message with any special references such as mentions converted. </summary>
|
/// <summary> Returns the content of this message with any special references such as mentions converted. </summary>
|
||||||
/// <remarks> This value is lazy loaded and only processed on first request. Each subsequent request will pull from cache. </remarks>
|
/// <remarks> This value is lazy loaded and only processed on first request. Each subsequent request will pull from cache. </remarks>
|
||||||
public string Text => _cleanText != null ? _cleanText : (_cleanText = _client.CleanMessageText(RawText));
|
public string Text => _cleanText != null ? _cleanText : (_cleanText = _client.CleanMessageText(RawText));
|
||||||
/// <summary> Returns the timestamp of this message. </summary>
|
/// <summary> Returns the timestamp for when this message was sent. </summary>
|
||||||
public DateTime Timestamp { get; internal set; }
|
public DateTime Timestamp { get; internal set; }
|
||||||
|
/// <summary> Returns the timestamp for when this message was last edited. </summary>
|
||||||
|
public DateTime? EditedTimestamp { get; internal set; }
|
||||||
/// <summary> Returns the attachments included in this message. </summary>
|
/// <summary> Returns the attachments included in this message. </summary>
|
||||||
public Attachment[] Attachments { get; internal set; }
|
public Attachment[] Attachments { get; internal set; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user