Add missing IThreadUser interface (#2055)

* Implement

* Add IMentionable to RestThreadUser

* Rather move mentionable to interface for consistency.

* Further consistency
This commit is contained in:
Armano den Boef
2022-01-27 14:51:30 +01:00
committed by GitHub
parent b14af1c008
commit 3475bd8d6f
3 changed files with 44 additions and 17 deletions

View File

@@ -7,23 +7,20 @@ namespace Discord.Rest
/// <summary>
/// Represents a thread user received over the REST api.
/// </summary>
public class RestThreadUser : RestEntity<ulong>
public class RestThreadUser : RestEntity<ulong>, IThreadUser
{
/// <summary>
/// Gets the <see cref="RestThreadChannel"/> this user is in.
/// </summary>
/// <inheritdoc/>
public IThreadChannel Thread { get; }
/// <summary>
/// Gets the timestamp for when this user joined this thread.
/// </summary>
public DateTimeOffset JoinedAt { get; private set; }
/// <inheritdoc/>
public DateTimeOffset ThreadJoinedAt { get; private set; }
/// <summary>
/// Gets the guild this user is in.
/// </summary>
/// <inheritdoc/>
public IGuild Guild { get; }
/// <inheritdoc/>
public string Mention => MentionUtils.MentionUser(Id);
internal RestThreadUser(BaseDiscordClient discord, IGuild guild, IThreadChannel channel, ulong id)
: base(discord, id)
{
@@ -40,7 +37,7 @@ namespace Discord.Rest
internal void Update(Model model)
{
JoinedAt = model.JoinTimestamp;
ThreadJoinedAt = model.JoinTimestamp;
}
/// <summary>