@@ -11,7 +11,7 @@ namespace Discord.Rest | |||||
private long _timestampTicks; | private long _timestampTicks; | ||||
public ulong ChannelId { get; } | public ulong ChannelId { get; } | ||||
public IUser Author { get; } | |||||
public RestUser Author { get; } | |||||
public string Content { get; private set; } | public string Content { get; private set; } | ||||
@@ -28,10 +28,11 @@ namespace Discord.Rest | |||||
public DateTimeOffset Timestamp => DateTimeUtils.FromTicks(_timestampTicks); | public DateTimeOffset Timestamp => DateTimeUtils.FromTicks(_timestampTicks); | ||||
internal RestMessage(BaseDiscordClient discord, ulong id, ulong channelId) | |||||
internal RestMessage(BaseDiscordClient discord, ulong id, ulong channelId, RestUser author) | |||||
: base(discord, id) | : base(discord, id) | ||||
{ | { | ||||
ChannelId = channelId; | ChannelId = channelId; | ||||
Author = author; | |||||
} | } | ||||
internal static RestMessage Create(BaseDiscordClient discord, Model model) | internal static RestMessage Create(BaseDiscordClient discord, Model model) | ||||
{ | { | ||||
@@ -58,6 +59,7 @@ namespace Discord.Rest | |||||
public override string ToString() => Content; | public override string ToString() => Content; | ||||
MessageType IMessage.Type => MessageType.Default; | MessageType IMessage.Type => MessageType.Default; | ||||
IUser IMessage.Author => Author; | |||||
IReadOnlyCollection<IAttachment> IMessage.Attachments => Attachments; | IReadOnlyCollection<IAttachment> IMessage.Attachments => Attachments; | ||||
IReadOnlyCollection<IEmbed> IMessage.Embeds => Embeds; | IReadOnlyCollection<IEmbed> IMessage.Embeds => Embeds; | ||||
IReadOnlyCollection<IRole> IMessage.MentionedRoles => MentionedRoles; | IReadOnlyCollection<IRole> IMessage.MentionedRoles => MentionedRoles; | ||||
@@ -8,13 +8,13 @@ namespace Discord.Rest | |||||
{ | { | ||||
public MessageType Type { get; private set; } | public MessageType Type { get; private set; } | ||||
internal RestSystemMessage(BaseDiscordClient discord, ulong id, ulong channelId) | |||||
: base(discord, id, channelId) | |||||
internal RestSystemMessage(BaseDiscordClient discord, ulong id, ulong channelId, RestUser author) | |||||
: base(discord, id, channelId, author) | |||||
{ | { | ||||
} | } | ||||
internal new static RestSystemMessage Create(BaseDiscordClient discord, Model model) | internal new static RestSystemMessage Create(BaseDiscordClient discord, Model model) | ||||
{ | { | ||||
var entity = new RestSystemMessage(discord, model.Id, model.ChannelId); | |||||
var entity = new RestSystemMessage(discord, model.Id, model.ChannelId, RestUser.Create(discord, model.Author.Value)); | |||||
entity.Update(model); | entity.Update(model); | ||||
return entity; | return entity; | ||||
} | } | ||||
@@ -33,13 +33,13 @@ namespace Discord.Rest | |||||
public override IReadOnlyCollection<RestRole> MentionedRoles => _mentionedRoles; | public override IReadOnlyCollection<RestRole> MentionedRoles => _mentionedRoles; | ||||
public override IReadOnlyCollection<RestUser> MentionedUsers => _mentionedUsers; | public override IReadOnlyCollection<RestUser> MentionedUsers => _mentionedUsers; | ||||
internal RestUserMessage(BaseDiscordClient discord, ulong id, ulong channelId) | |||||
: base(discord, id, channelId) | |||||
internal RestUserMessage(BaseDiscordClient discord, ulong id, ulong channelId, RestUser author) | |||||
: base(discord, id, channelId, author) | |||||
{ | { | ||||
} | } | ||||
internal new static RestUserMessage Create(BaseDiscordClient discord, Model model) | internal new static RestUserMessage Create(BaseDiscordClient discord, Model model) | ||||
{ | { | ||||
var entity = new RestUserMessage(discord, model.Id, model.ChannelId); | |||||
var entity = new RestUserMessage(discord, model.Id, model.ChannelId, RestUser.Create(discord, model.Author.Value)); | |||||
entity.Update(model); | entity.Update(model); | ||||
return entity; | return entity; | ||||
} | } | ||||