fix: Rest message type (#1877)
This commit is contained in:
@@ -71,6 +71,8 @@ namespace Discord.Rest
|
||||
public MessageReference Reference { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public MessageFlags? Flags { get; private set; }
|
||||
/// <inheritdoc/>
|
||||
public MessageType Type { get; private set; }
|
||||
|
||||
internal RestMessage(BaseDiscordClient discord, ulong id, IMessageChannel channel, IUser author, MessageSource source)
|
||||
: base(discord, id)
|
||||
@@ -88,6 +90,8 @@ namespace Discord.Rest
|
||||
}
|
||||
internal virtual void Update(Model model)
|
||||
{
|
||||
Type = model.Type;
|
||||
|
||||
if (model.Timestamp.IsSpecified)
|
||||
_timestampTicks = model.Timestamp.Value.UtcTicks;
|
||||
|
||||
@@ -166,8 +170,6 @@ namespace Discord.Rest
|
||||
/// </returns>
|
||||
public override string ToString() => Content;
|
||||
|
||||
/// <inheritdoc />
|
||||
MessageType IMessage.Type => MessageType.Default;
|
||||
IUser IMessage.Author => Author;
|
||||
/// <inheritdoc />
|
||||
IReadOnlyCollection<IAttachment> IMessage.Attachments => Attachments;
|
||||
|
||||
@@ -9,9 +9,6 @@ namespace Discord.Rest
|
||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
public class RestSystemMessage : RestMessage, ISystemMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public MessageType Type { get; private set; }
|
||||
|
||||
internal RestSystemMessage(BaseDiscordClient discord, ulong id, IMessageChannel channel, IUser author)
|
||||
: base(discord, id, channel, author, MessageSource.System)
|
||||
{
|
||||
@@ -25,8 +22,6 @@ namespace Discord.Rest
|
||||
internal override void Update(Model model)
|
||||
{
|
||||
base.Update(model);
|
||||
|
||||
Type = model.Type;
|
||||
}
|
||||
|
||||
private string DebuggerDisplay => $"{Author}: {Content} ({Id}, {Type})";
|
||||
|
||||
Reference in New Issue
Block a user