@@ -0,0 +1,17 @@ | |||||
using System; | |||||
namespace Discord | |||||
{ | |||||
public interface IThreadUser | |||||
{ | |||||
/// <summary> | |||||
/// Gets the <see cref="IThreadChannel"/> this user is in. | |||||
/// </summary> | |||||
IThreadChannel Thread { get; } | |||||
/// <summary> | |||||
/// Gets the timestamp for when this user joined this thread. | |||||
/// </summary> | |||||
DateTimeOffset ThreadJoinedAt { get; } | |||||
} | |||||
} |
@@ -7,17 +7,13 @@ namespace Discord.Rest | |||||
/// <summary> | /// <summary> | ||||
/// Represents a thread user received over the REST api. | /// Represents a thread user received over the REST api. | ||||
/// </summary> | /// </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; } | 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> | /// <summary> | ||||
/// Gets the guild this user is in. | /// Gets the guild this user is in. | ||||
@@ -40,7 +36,7 @@ namespace Discord.Rest | |||||
internal void Update(Model model) | internal void Update(Model model) | ||||
{ | { | ||||
JoinedAt = model.JoinTimestamp; | |||||
ThreadJoinedAt = model.JoinTimestamp; | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -10,16 +10,14 @@ namespace Discord.WebSocket | |||||
/// <summary> | /// <summary> | ||||
/// Represents a thread user received over the gateway. | /// Represents a thread user received over the gateway. | ||||
/// </summary> | /// </summary> | ||||
public class SocketThreadUser : SocketUser, IGuildUser | |||||
public class SocketThreadUser : SocketUser, IThreadUser, IGuildUser | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// Gets the <see cref="SocketThreadChannel"/> this user is in. | /// Gets the <see cref="SocketThreadChannel"/> this user is in. | ||||
/// </summary> | /// </summary> | ||||
public SocketThreadChannel Thread { get; private set; } | public SocketThreadChannel Thread { get; private set; } | ||||
/// <summary> | |||||
/// Gets the timestamp for when this user joined this thread. | |||||
/// </summary> | |||||
/// <inheritdoc/> | |||||
public DateTimeOffset ThreadJoinedAt { get; private set; } | public DateTimeOffset ThreadJoinedAt { get; private set; } | ||||
/// <summary> | /// <summary> | ||||
@@ -180,6 +178,10 @@ namespace Discord.WebSocket | |||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
public Task RemoveTimeOutAsync(RequestOptions options = null) => GuildUser.RemoveTimeOutAsync(options); | public Task RemoveTimeOutAsync(RequestOptions options = null) => GuildUser.RemoveTimeOutAsync(options); | ||||
/// <inheritdoc /> | |||||
IThreadChannel IThreadUser.Thread => Thread; | |||||
/// <inheritdoc/> | /// <inheritdoc/> | ||||
GuildPermissions IGuildUser.GuildPermissions => GuildUser.GuildPermissions; | GuildPermissions IGuildUser.GuildPermissions => GuildUser.GuildPermissions; | ||||