Browse Source

Added User documentation

tags/docs-0.9
Brandon Smith 10 years ago
parent
commit
3a4cc92c30
1 changed files with 18 additions and 1 deletions
  1. +18
    -1
      src/Discord.Net/User.cs

+ 18
- 1
src/Discord.Net/User.cs View File

@@ -8,20 +8,36 @@ namespace Discord
{ {
private readonly DiscordClient _client; private readonly DiscordClient _client;


/// <summary> Returns the unique identifier for this user. </summary>
public string Id { get; } public string Id { get; }
/// <summary> Returns the name of this channel. </summary>
public string Name { get; internal set; } public string Name { get; internal set; }


/// <summary> Returns the unique identifier for this user's current avatar. </summary>
public string AvatarId { get; internal set; } public string AvatarId { get; internal set; }
/// <summary> Returns the URL to this user's current avatar. </summary>
public string AvatarUrl => Endpoints.UserAvatar(Id, AvatarId); public string AvatarUrl => Endpoints.UserAvatar(Id, AvatarId);
/// <summary> Returns a by-name unique identifier separating this user from others with the same name. </summary>
public string Discriminator { get; internal set; } public string Discriminator { get; internal set; }
[JsonIgnore] [JsonIgnore]
/// <summary> Returns the email for this user. </summary>
/// <remarks> This field is only ever populated for the current logged in user. </remarks>
public string Email { get; internal set; } public string Email { get; internal set; }
[JsonIgnore] [JsonIgnore]
public bool IsVerified { get; internal set; } = true;
/// <summary> Returns if the email for this user has been verified. </summary>
/// <remarks> This field is only ever populated for the current logged in user. </remarks>
public bool IsVerified { get; internal set; }
/// <summary> Returns the id for the game this user is currently playing. </summary>
public string GameId { get; internal set; } public string GameId { get; internal set; }
/// <summary> Returns the current status for this user. </summary>
public string Status { get; internal set; } public string Status { get; internal set; }

/// <summary> Returns the string "&lt;@Id&gt;" to be used as a shortcut when including mentions in text. </summary>
public string Mention { get { return $"<@{Id}>"; } } public string Mention { get { return $"<@{Id}>"; } }


//TODO: Add voice
/// <summary> Returns the time this user last sent a message. </summary>
/// <remarks> Is not currently affected by voice activity </remarks>
public DateTime LastActivity { get; private set; } public DateTime LastActivity { get; private set; }


internal User(string id, DiscordClient client) internal User(string id, DiscordClient client)
@@ -29,6 +45,7 @@ namespace Discord
Id = id; Id = id;
_client = client; _client = client;
LastActivity = DateTime.UtcNow; LastActivity = DateTime.UtcNow;
IsVerified = true;
} }


internal void UpdateActivity(DateTime activity) internal void UpdateActivity(DateTime activity)


Loading…
Cancel
Save