Browse Source

Added ISelfUser.IsMfaEnabled

tags/1.0-rc
RogueException 9 years ago
parent
commit
febd9636f7
3 changed files with 12 additions and 4 deletions
  1. +7
    -3
      src/Discord.Net/API/Common/User.cs
  2. +2
    -0
      src/Discord.Net/Entities/Users/ISelfUser.cs
  3. +3
    -1
      src/Discord.Net/Entities/Users/SelfUser.cs

+ 7
- 3
src/Discord.Net/API/Common/User.cs View File

@@ -10,13 +10,17 @@ namespace Discord.API
public string Username { get; set; } public string Username { get; set; }
[JsonProperty("discriminator")] [JsonProperty("discriminator")]
public string Discriminator { get; set; } public string Discriminator { get; set; }
[JsonProperty("bot")]
public bool Bot { get; set; }
[JsonProperty("avatar")] [JsonProperty("avatar")]
public string Avatar { get; set; } public string Avatar { get; set; }

//CurrentUser
[JsonProperty("verified")] [JsonProperty("verified")]
public bool IsVerified { get; set; }
public bool Verified { get; set; }
[JsonProperty("email")] [JsonProperty("email")]
public string Email { get; set; } public string Email { get; set; }
[JsonProperty("bot")]
public bool Bot { get; set; }
[JsonProperty("mfa_enabled")]
public bool MfaEnabled { get; set; }
} }
} }

+ 2
- 0
src/Discord.Net/Entities/Users/ISelfUser.cs View File

@@ -10,6 +10,8 @@ namespace Discord
string Email { get; } string Email { get; }
/// <summary> Returns true if this user's email has been verified. </summary> /// <summary> Returns true if this user's email has been verified. </summary>
bool IsVerified { get; } bool IsVerified { get; }
/// <summary> Returns true if this user has enabled MFA on their account. </summary>
bool IsMfaEnabled { get; }


Task ModifyAsync(Action<ModifyCurrentUserParams> func); Task ModifyAsync(Action<ModifyCurrentUserParams> func);
} }

+ 3
- 1
src/Discord.Net/Entities/Users/SelfUser.cs View File

@@ -9,6 +9,7 @@ namespace Discord
{ {
public string Email { get; private set; } public string Email { get; private set; }
public bool IsVerified { get; private set; } public bool IsVerified { get; private set; }
public bool IsMfaEnabled { get; private set; }


public override DiscordClient Discord { get; } public override DiscordClient Discord { get; }


@@ -24,7 +25,8 @@ namespace Discord
base.Update(model, source); base.Update(model, source);


Email = model.Email; Email = model.Email;
IsVerified = model.IsVerified;
IsVerified = model.Verified;
IsMfaEnabled = model.MfaEnabled;
} }
public async Task UpdateAsync() public async Task UpdateAsync()


Loading…
Cancel
Save