Add DisplayName property to IGuildUser. (#2107)
This commit is contained in:
@@ -18,6 +18,13 @@ namespace Discord
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
DateTimeOffset? JoinedAt { get; }
|
DateTimeOffset? JoinedAt { get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// Gets the displayed name for this user.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// A string representing the display name of the user; If the nickname is null, this will be the username.
|
||||||
|
/// </returns>
|
||||||
|
string DisplayName { get; }
|
||||||
|
/// <summary>
|
||||||
/// Gets the nickname for this user.
|
/// Gets the nickname for this user.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ namespace Discord.Rest
|
|||||||
private long? _timedOutTicks;
|
private long? _timedOutTicks;
|
||||||
private long? _joinedAtTicks;
|
private long? _joinedAtTicks;
|
||||||
private ImmutableArray<ulong> _roleIds;
|
private ImmutableArray<ulong> _roleIds;
|
||||||
|
/// <inheritdoc />
|
||||||
|
public string DisplayName => Nickname ?? Username;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Nickname { get; private set; }
|
public string Nickname { get; private set; }
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ namespace Discord.Rest
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
DateTimeOffset? IGuildUser.JoinedAt => null;
|
DateTimeOffset? IGuildUser.JoinedAt => null;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
string IGuildUser.DisplayName => null;
|
||||||
|
/// <inheritdoc />
|
||||||
string IGuildUser.Nickname => null;
|
string IGuildUser.Nickname => null;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
string IGuildUser.GuildAvatarId => null;
|
string IGuildUser.GuildAvatarId => null;
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ namespace Discord.WebSocket
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public SocketGuild Guild { get; }
|
public SocketGuild Guild { get; }
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
public string DisplayName => Nickname ?? Username;
|
||||||
|
/// <inheritdoc />
|
||||||
public string Nickname { get; private set; }
|
public string Nickname { get; private set; }
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public string GuildAvatarId { get; private set; }
|
public string GuildAvatarId { get; private set; }
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ namespace Discord.WebSocket
|
|||||||
public DateTimeOffset? JoinedAt
|
public DateTimeOffset? JoinedAt
|
||||||
=> GuildUser.JoinedAt;
|
=> GuildUser.JoinedAt;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public string DisplayName
|
||||||
|
=> GuildUser.Nickname ?? GuildUser.Username;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public string Nickname
|
public string Nickname
|
||||||
=> GuildUser.Nickname;
|
=> GuildUser.Nickname;
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ namespace Discord.WebSocket
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
DateTimeOffset? IGuildUser.JoinedAt => null;
|
DateTimeOffset? IGuildUser.JoinedAt => null;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
string IGuildUser.DisplayName => null;
|
||||||
|
/// <inheritdoc />
|
||||||
string IGuildUser.Nickname => null;
|
string IGuildUser.Nickname => null;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
string IGuildUser.GuildAvatarId => null;
|
string IGuildUser.GuildAvatarId => null;
|
||||||
|
|||||||
Reference in New Issue
Block a user