diff --git a/src/Discord.Net.Core/Entities/Users/IThreadUser.cs b/src/Discord.Net.Core/Entities/Users/IThreadUser.cs new file mode 100644 index 000000000..76f6ffc01 --- /dev/null +++ b/src/Discord.Net.Core/Entities/Users/IThreadUser.cs @@ -0,0 +1,17 @@ +using System; + +namespace Discord +{ + public interface IThreadUser + { + /// + /// Gets the this user is in. + /// + IThreadChannel Thread { get; } + + /// + /// Gets the timestamp for when this user joined this thread. + /// + DateTimeOffset ThreadJoinedAt { get; } + } +} diff --git a/src/Discord.Net.Rest/Entities/Users/RestThreadUser.cs b/src/Discord.Net.Rest/Entities/Users/RestThreadUser.cs index 82830dafd..978586919 100644 --- a/src/Discord.Net.Rest/Entities/Users/RestThreadUser.cs +++ b/src/Discord.Net.Rest/Entities/Users/RestThreadUser.cs @@ -7,17 +7,13 @@ namespace Discord.Rest /// /// Represents a thread user received over the REST api. /// - public class RestThreadUser : RestEntity + public class RestThreadUser : RestEntity, IThreadUser { - /// - /// Gets the this user is in. - /// + /// public IThreadChannel Thread { get; } - /// - /// Gets the timestamp for when this user joined this thread. - /// - public DateTimeOffset JoinedAt { get; private set; } + /// + public DateTimeOffset ThreadJoinedAt { get; private set; } /// /// Gets the guild this user is in. @@ -40,7 +36,7 @@ namespace Discord.Rest internal void Update(Model model) { - JoinedAt = model.JoinTimestamp; + ThreadJoinedAt = model.JoinTimestamp; } /// diff --git a/src/Discord.Net.WebSocket/Entities/Users/SocketThreadUser.cs b/src/Discord.Net.WebSocket/Entities/Users/SocketThreadUser.cs index f7ed2e5f5..97a8faf24 100644 --- a/src/Discord.Net.WebSocket/Entities/Users/SocketThreadUser.cs +++ b/src/Discord.Net.WebSocket/Entities/Users/SocketThreadUser.cs @@ -10,16 +10,14 @@ namespace Discord.WebSocket /// /// Represents a thread user received over the gateway. /// - public class SocketThreadUser : SocketUser, IGuildUser + public class SocketThreadUser : SocketUser, IThreadUser, IGuildUser { /// /// Gets the this user is in. /// public SocketThreadChannel Thread { get; private set; } - /// - /// Gets the timestamp for when this user joined this thread. - /// + /// public DateTimeOffset ThreadJoinedAt { get; private set; } /// @@ -180,6 +178,10 @@ namespace Discord.WebSocket /// public Task RemoveTimeOutAsync(RequestOptions options = null) => GuildUser.RemoveTimeOutAsync(options); + + /// + IThreadChannel IThreadUser.Thread => Thread; + /// GuildPermissions IGuildUser.GuildPermissions => GuildUser.GuildPermissions;