Browse Source

Added DefaultMessageNotifications

tags/1.0-rc
RogueException 9 years ago
parent
commit
26eb572fdb
5 changed files with 18 additions and 1 deletions
  1. +2
    -0
      src/Discord.Net/API/Common/Guild.cs
  2. +0
    -1
      src/Discord.Net/API/DiscordAPIClient.cs
  3. +10
    -0
      src/Discord.Net/Entities/Guilds/DefaultMessageNotifications.cs
  4. +2
    -0
      src/Discord.Net/Entities/Guilds/Guild.cs
  5. +4
    -0
      src/Discord.Net/Entities/Guilds/IGuild.cs

+ 2
- 0
src/Discord.Net/API/Common/Guild.cs 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; }
}
}

+ 0
- 1
src/Discord.Net/API/DiscordAPIClient.cs 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);
}


+ 10
- 0
src/Discord.Net/Entities/Guilds/DefaultMessageNotifications.cs 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
}
}

+ 2
- 0
src/Discord.Net/Entities/Guilds/Guild.cs 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)
{


+ 4
- 0
src/Discord.Net/Entities/Guilds/IGuild.cs 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>


Loading…
Cancel
Save