Added DefaultMessageNotifications

This commit is contained in:
RogueException
2016-06-25 00:14:20 -03:00
parent 11c9b61495
commit 26eb572fdb
5 changed files with 18 additions and 1 deletions

View File

@@ -36,5 +36,7 @@ namespace Discord.API
public string[] Features { get; set; }
[JsonProperty("mfa_level")]
public MfaLevel MfaLevel { get; set; }
[JsonProperty("default_message_notifications")]
public DefaultMessageNotifications DefaultMessageNotifications { get; set; }
}
}

View File

@@ -543,7 +543,6 @@ namespace Discord.API
Preconditions.NotNullOrEmpty(args.Name, nameof(args.Name));
Preconditions.GreaterThan(args.OwnerId, 0, nameof(args.OwnerId));
Preconditions.NotNull(args.Region, nameof(args.Region));
Preconditions.AtLeast(args.VerificationLevel, 0, nameof(args.VerificationLevel));
return await SendAsync<Guild>("PATCH", $"guilds/{guildId}", args, options: options).ConfigureAwait(false);
}

View File

@@ -0,0 +1,10 @@
namespace Discord
{
public enum DefaultMessageNotifications
{
/// <summary> By default, only mentions will trigger notifications. </summary>
MentionsOnly = 0,
/// <summary> By default, all messages will trigger notifications. </summary>
AllMessages = 1
}
}

View File

@@ -24,6 +24,7 @@ namespace Discord
public bool IsEmbeddable { get; private set; }
public VerificationLevel VerificationLevel { get; private set; }
public MfaLevel MfaLevel { get; private set; }
public DefaultMessageNotifications DefaultMessageNotifications { get; private set; }
public override DiscordClient Discord { get; }
public ulong? AFKChannelId { get; private set; }
@@ -62,6 +63,7 @@ namespace Discord
_splashId = model.Splash;
VerificationLevel = model.VerificationLevel;
MfaLevel = model.MfaLevel;
DefaultMessageNotifications = model.DefaultMessageNotifications;
if (model.Emojis != null)
{

View File

@@ -13,6 +13,10 @@ namespace Discord
int AFKTimeout { get; }
/// <summary> Returns true if this guild is embeddable (e.g. widget) </summary>
bool IsEmbeddable { get; }
/// <summary> Gets the default message notifications for users who haven't explicitly set their notification settings. </summary>
DefaultMessageNotifications DefaultMessageNotifications { get; }
/// <summary> Gets the level of mfa requirements a user must fulfill before being allowed to perform administrative actions in this guild. </summary>
MfaLevel MfaLevel { get; }
/// <summary> Gets the level of requirements a user must fulfill before being allowed to post messages in this guild. </summary>
VerificationLevel VerificationLevel { get; }
/// <summary> Returns the url to this guild's icon, or null if one is not set. </summary>