Added discriminator to User.ToString and Channel.ToString (when private)

This commit is contained in:
RogueException
2015-12-13 23:18:41 -04:00
parent 3e72954c4c
commit 028e012d7e
2 changed files with 4 additions and 4 deletions

View File

@@ -120,11 +120,11 @@ namespace Discord
x => x.AddChannel(this),
x => x.RemoveChannel(this));
_recipient = new Reference<User>(recipientId,
x => _client.Users.GetOrAdd(x, _server.Id),
x => _client.Users.GetOrAdd(x, _server.Id),
x =>
{
Name = "@" + x.Name;
if (_server.Id == null)
Name = $"@{x}";
if (_server.Id == null)
x.Global.PrivateChannel = this;
},
x =>

View File

@@ -281,6 +281,6 @@ namespace Discord
public override bool Equals(object obj) => obj is User && (obj as User).Id == Id;
public override int GetHashCode() => unchecked(Id.GetHashCode() + 7230);
public override string ToString() => Name ?? IdConvert.ToString(Id);
public override string ToString() => Name != null ? $"{Name}#{Discriminator}" : IdConvert.ToString(Id);
}
}