Browse Source

Add ExplicitContentFilter property to Guild

pull/1165/head
Chris Johnston 7 years ago
parent
commit
d9dd2bb677
4 changed files with 21 additions and 1 deletions
  1. +13
    -0
      src/Discord.Net.Core/Entities/Guilds/ExplicitContentFilterLevel.cs
  2. +3
    -1
      src/Discord.Net.Rest/API/Common/Guild.cs
  3. +2
    -0
      src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
  4. +3
    -0
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs

+ 13
- 0
src/Discord.Net.Core/Entities/Guilds/ExplicitContentFilterLevel.cs View File

@@ -0,0 +1,13 @@
namespace Discord
{
public enum ExplicitContentFilterLevel
{
/// <summary> No messages will be scanned. </summary>
Disabled = 0,
/// <summary> Scans messages from all guild members that do not have a role. </summary>
/// <remarks> Recommented option for servers that use roles for trusted membership. </remarks>
MembersWithoutRoles = 1,
/// <summary> Scan messages sent by all guild members. </summary>
AllMembers = 2
}
}

+ 3
- 1
src/Discord.Net.Rest/API/Common/Guild.cs View File

@@ -1,4 +1,4 @@
#pragma warning disable CS1591
#pragma warning disable CS1591
using Newtonsoft.Json;

namespace Discord.API
@@ -41,5 +41,7 @@ namespace Discord.API
public MfaLevel MfaLevel { get; set; }
[JsonProperty("default_message_notifications")]
public DefaultMessageNotifications DefaultMessageNotifications { get; set; }
[JsonProperty("explicit_content_filter")]
public ExplicitContentFilterLevel ExplicitContentFilter { get; set; }
}
}

+ 2
- 0
src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs View File

@@ -32,6 +32,7 @@ namespace Discord.Rest
public MfaLevel MfaLevel { get; private set; }
/// <inheritdoc />
public DefaultMessageNotifications DefaultMessageNotifications { get; private set; }
public ExplicitContentFilterLevel ExplicitContentFilter { get; private set; }

/// <inheritdoc />
public ulong? AFKChannelId { get; private set; }
@@ -98,6 +99,7 @@ namespace Discord.Rest
VerificationLevel = model.VerificationLevel;
MfaLevel = model.MfaLevel;
DefaultMessageNotifications = model.DefaultMessageNotifications;
ExplicitContentFilter = model.ExplicitContentFilter;

if (model.Emojis != null)
{


+ 3
- 0
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -50,6 +50,8 @@ namespace Discord.WebSocket
public MfaLevel MfaLevel { get; private set; }
/// <inheritdoc />
public DefaultMessageNotifications DefaultMessageNotifications { get; private set; }
/// <inheritdoc />
public ExplicitContentFilterLevel ExplicitContentFilter { get; private set; }
/// <summary>
/// Gets the number of members.
/// </summary>
@@ -346,6 +348,7 @@ namespace Discord.WebSocket
VerificationLevel = model.VerificationLevel;
MfaLevel = model.MfaLevel;
DefaultMessageNotifications = model.DefaultMessageNotifications;
ExplicitContentFilter = model.ExplicitContentFilter;

if (model.Emojis != null)
{


Loading…
Cancel
Save