|
@@ -38,6 +38,9 @@ namespace Discord.WebSocket |
|
|
/// <inheritdoc /> |
|
|
/// <inheritdoc /> |
|
|
public string Content { get; private set; } |
|
|
public string Content { get; private set; } |
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
|
|
|
public string CleanContent => SanitizeMessage(); |
|
|
|
|
|
|
|
|
/// <inheritdoc /> |
|
|
/// <inheritdoc /> |
|
|
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); |
|
|
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id); |
|
|
/// <inheritdoc /> |
|
|
/// <inheritdoc /> |
|
@@ -139,7 +142,11 @@ namespace Discord.WebSocket |
|
|
_timestampTicks = model.Timestamp.Value.UtcTicks; |
|
|
_timestampTicks = model.Timestamp.Value.UtcTicks; |
|
|
|
|
|
|
|
|
if (model.Content.IsSpecified) |
|
|
if (model.Content.IsSpecified) |
|
|
|
|
|
{ |
|
|
Content = model.Content.Value; |
|
|
Content = model.Content.Value; |
|
|
|
|
|
//Update CleanContent Property |
|
|
|
|
|
SanitizeMessage(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (model.Application.IsSpecified) |
|
|
if (model.Application.IsSpecified) |
|
|
{ |
|
|
{ |
|
@@ -265,6 +272,13 @@ namespace Discord.WebSocket |
|
|
/// <inheritdoc /> |
|
|
/// <inheritdoc /> |
|
|
IReadOnlyCollection<IStickerItem> IMessage.Stickers => Stickers; |
|
|
IReadOnlyCollection<IStickerItem> IMessage.Stickers => Stickers; |
|
|
|
|
|
|
|
|
|
|
|
internal string SanitizeMessage() |
|
|
|
|
|
{ |
|
|
|
|
|
var newContent = MentionUtils.Resolve(this, 0, TagHandling.Sanitize, TagHandling.Sanitize, TagHandling.Sanitize, TagHandling.Sanitize, TagHandling.Sanitize); |
|
|
|
|
|
newContent = Format.StripMarkDown(newContent); |
|
|
|
|
|
return newContent; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
internal void AddReaction(SocketReaction reaction) |
|
|
internal void AddReaction(SocketReaction reaction) |
|
|
{ |
|
|
{ |
|
|
_reactions.Add(reaction); |
|
|
_reactions.Add(reaction); |
|
|