Browse Source

Added MfaLevel

pull/108/head
RogueException 9 years ago
parent
commit
11c9b61495
3 changed files with 16 additions and 2 deletions
  1. +2
    -0
      src/Discord.Net/API/Common/Guild.cs
  2. +4
    -2
      src/Discord.Net/Entities/Guilds/Guild.cs
  3. +10
    -0
      src/Discord.Net/Entities/Guilds/MfaLevel.cs

+ 2
- 0
src/Discord.Net/API/Common/Guild.cs View File

@@ -34,5 +34,7 @@ namespace Discord.API
public Emoji[] Emojis { get; set; }
[JsonProperty("features")]
public string[] Features { get; set; }
[JsonProperty("mfa_level")]
public MfaLevel MfaLevel { get; set; }
}
}

+ 4
- 2
src/Discord.Net/Entities/Guilds/Guild.cs View File

@@ -23,12 +23,13 @@ namespace Discord
public int AFKTimeout { get; private set; }
public bool IsEmbeddable { get; private set; }
public VerificationLevel VerificationLevel { get; private set; }
public MfaLevel MfaLevel { get; private set; }

public override DiscordClient Discord { get; }
public ulong? AFKChannelId { get; private set; }
public ulong? EmbedChannelId { get; private set; }
public ulong OwnerId { get; private set; }
public string VoiceRegionId { get; private set; }
public override DiscordClient Discord { get; }
public ImmutableArray<Emoji> Emojis { get; protected set; }
public ImmutableArray<string> Features { get; protected set; }

@@ -60,7 +61,8 @@ namespace Discord
VoiceRegionId = model.Region;
_splashId = model.Splash;
VerificationLevel = model.VerificationLevel;
MfaLevel = model.MfaLevel;

if (model.Emojis != null)
{
var emojis = ImmutableArray.CreateBuilder<Emoji>(model.Emojis.Length);


+ 10
- 0
src/Discord.Net/Entities/Guilds/MfaLevel.cs View File

@@ -0,0 +1,10 @@
namespace Discord
{
public enum MfaLevel
{
/// <summary> Users have no additional MFA restriction on this guild. </summary>
Disabled = 0,
/// <summary> Users must have MFA enabled on their account to perform administrative actions. </summary>
Enabled = 1
}
}

Loading…
Cancel
Save